JavaScript, the good, the bad, the ugly

Saturday, February 22, 2014

JSLint.com defines a professional subset of JavaScript


Return statement returning the result of an object literal


Always use ===, never ==


Multiline string literals


Avoid ambiguity


Var statement


B is an implicit global variable, not declared


Curly braces around conditional block


An object is a dynamic collection of properties


Object literals


New prefix operator, this is what it does under the hood


Javascript didn't get it right


These are all objects, inherit from object


Numbers


Default Success Warning Important Info Inverse
B S W I ? O