In current Chrome, if I do this:
var i = 'foo'; i();
I get the error 'string is not a function' . I get similar errors if i is a number, undefined, etc.
However, from some real, more complex code, sometimes I see another error:
' expected function : function () {}'
I am trying to figure out how these two errors differ, or, to look at it differently, how to write minimal code that will throw an “expected function” error.
I tried messing around with callbacks and calling / applying, but none of them run this. Can someone explain how to reproduce this error?
Gregt source share