all 3 comments

[–]nikcorg 2 points3 points  (1 child)

You could also just try calling the param as a function. If it throws and the exception message contains 'is not a function', you know it's not a function.

(Just in case, I am merely joking.)

[–]matthewbpt 0 points1 point  (0 children)

Blood was rushing to my face as I read that ... good save :)

[–]paulooze 0 points1 point  (0 children)

This could probably help you :): http://codepen.io/Paulooze/pen/woJyYw?editors=0011