When trying to do this:
setTimeout(function(){alert("Boo");}, 500);
I accidentally wrote this:
setTimeout(new function(){alert("Boo");}, 500);
The first version waits for 500 milliseconds, then an alert. The latter warns immediately.
Why does adding a new before a function cause this behavior?
source share