Take a look at the screenshot...
The reason why I'm experimenting with this is because I did a simple Google search for how to check if a parameter is a function, and I found this...
var getClass = {}.toString;
...
function isFunctionA(object) {
return object && getClass.call(object) == '[object Function]';
}
source: http://jsperf.com/alternative-isfunction-implementations/4
So what is the difference between what I'm typing out and the example source code? Why is Chrome giving an error when entering just {}.toString
, but works fine when it is inside the parenthesis?