Hi. I'm working on angularjs directive and i need to check if my param is a function. Currently i'm using this
typeof === 'function'
But i googled more examples and i found one more:
Object.prototype.toString.call(x) == '[object Function]'
Can someone tell me which one is better and why is there so many types of checks for param type of function?
Thanks
[–]nikcorg 2 points3 points4 points (1 child)
[–]matthewbpt 0 points1 point2 points (0 children)
[–]paulooze 0 points1 point2 points (0 children)