JavaScript: {}==false is a SyntaxError?
In Firefox 3.5, I type this in the Firebug console : false=={} // => evals to false {}==false // syntax error What is the explanation for this ? bobince { at the start of a statement signals a ‘statement block’ (see ECMA-262-3 section 12.1), which contains a list of statements. } immediately ends the statement block with no statements in it. That's fine. But now the parser is looking for the next statement: ==false Huh? That's not a statement; syntax error. What are statement blocks for? Well, you are writing a statement block every time you say: if (something) { ... } JavaScript defines these