Too Long; Didn't Read
A curious case of a function definition that made me pause and squint. The code looked somewhat like this: Quick quiz: can you spot a problem here? The anonymous function is never called, thus the error message is never displayed. JavaScript throws a curve ball at the uninitiated by following a somewhat unique set of rules called "hoisting" The rules mean that the function declarations are automatically moved to the top of the enclosing scope. It does not really matter where the function is defined - before the call or after, as long as the call happens within the same scope as the function declaration.