2. Declaring a Function function foo() {} var bar = function() {} The difference is that foo is defined at parse-time for a script block, whereas bar is defined at run-time.
4. Different ways of calling functions alert (“Hello, World!"); (alert) (“Hello, World!"); (function(x,y,z) {return (x+y+z)}) (1, 2, 3);
5. Using functional concepts Functions need not have names all the time. Functions can be assigned to variables like other values. A function expression can be written and enclosed in parentheses for application later. Functions can be passed as arguments to other functions.
6. JS does not have block scope. varx = 1; { var x = 2; } alert(x); // outputs 2 Block statements do not introduce a scope.
7. {} {} is object notation in JavaScript. An extremely terse and flexible way to pass information.
8. ; At the end of the last script without a ; on the end. If you have a ; at the start on yours, it's safe.
9. ++ and -- The ++ (increment) and -- (decrement) operators have been known to contribute to bad code by encouraging excessive trickiness. They are second only to faulty architecture in enabling to viruses and other security menaces. There is a plusplus option that prohibits the use of these operators. - Douglas Crockford
10. use === and !== instead of == and != == is not transitive. If you use === it would give false for all of these statements as expected.