always use === and !== instead of == and !=


alert('' == '0'); //false

alert(0 == ''); // true

alert(0 =='0'); // true

== is not transitive. If you use === it would give false for all of these statements as expected.

Multiline String literals


Described in: § 7.8.4 String Literals


var str = "This is a \

really, really \

long line!";


 debugger statement

This statement allows you to put breakpoints programmatically in your code just by:


// ...

debugger;

// ...

If a debugger is present or active, it will cause it to break immediately, right on that line.


Otherwise, if the debugger is not present or active this statement has no observable effect.