4 ms·
- Add semicolons, if that's what you prefer I do, but others disagree. My point is that when parsing fails, insert a semicolon and try again doesn't look very
by cygx 14y ago
- Add semicolons, if that's what you prefer
I do, but others disagree. My point is that when parsing fails, insert a semicolon and try again doesn't look very appealing from my personal criteria of language design.
- If you needed type checking, use ===
Which was added to the language after it was realized that the original semantics of == might not have been that well thought out.
- Function scope and object system, what's wrong with it?
Block scoping provides a finer level of encapsulation than function scope. Do you think `let` was added to the language (JS1.7, ECMA6) just for the heck of it?
As for the object system: Instead of using one of the well-known approaches (protoypal with cloning or class-based with inheritance), JS comes with a weird hybrid system inferior to both. Of course JS allows both approaches, but does not provide syntactic support for either, which makes them clumsy to use and open to fragmentation.