Global-by-default-unless-declared for variables is a recipe of disaster.
ES5 strict mode already disallows that.
If I declare a "var" inside a pair of curly braces, it should only be visible in those curly braces
The "let" keyword will fix that. It has block scope. Eventually all variables should be declared with "let".
Syntax for lambdas is overly verbose
There is still no agreement in the ECMAScript comitee about which option to take, but there are two very good proposals:
- Arrow function syntax taken from CoffeeScript: (x) -> x * x;
- Block lambdas, which allow you to treat chunks of code as data
Personally, I love arrow functions.
"new Boolean(false)" is considered true in a conditional expression..
I never heard of that particular example and trying "true == new Boolean(false)" always evaluates to false in a console. But yes, the == type coercing operand is the worst part of JavaScript. The === operator solves 99% of cases. For the 1% that it doesn't help with, ECMAScript 6 will have an "is" operator, and before that probably an Object.is() function.
While we're at it, what's up with the whole separation into primitives and objects?
I agree with you, everything should've been an object from the start. That's probably because of the Java legacy.