JavaScript's design took only ten days. Moreover, the designer didn't want to design it initially, he just wanted to complete the task assigned by company. It is now a very powerful client side programming language used in almost all the websites. It's an excellent language, but it also has some flaws.
1. Not suitable for large projects
JavaScript doesn't have namespace, it's hard to be modular, there is no standard for putting codes in multiple source files. It allows defining functions with the same name, the function defined later will override the one defined previously, it's hard for method overloading.
2. Small standard library
JavaScript provides small standard function library.
3. null and undefined
null is one kind of object, it means the object is null; undefined is a data type, it means something undefined.
  typeof null; // object
  typeof undefined; // undefined
It's very easy to mess up these two, but the meaning is completely different.
  var foo;
  alert(foo == null); // true
  alert(foo == undefined); // true
  alert(foo === null); // false
  alert(foo === undefined); // true
4. Global variable
JavaScript's global variables are visible in all modules, we can create global variable inside any function. This increases the complexity of program.
  a = 1;
  (function(){
    b=2;
    alert(a);
  })(); // 1
  alert(b); //2
5. The insertion of semi-colon at line end
Every statement in JavaScript should be ended with semi-colon. But if you forget to add semi-colon at the line end, the interpreter will not output the error, it will add the semi-colon at line end. Sometimes it may cause some errors difficult to find.
For example, the following function will not produce the expected result, the returned value is not an object, but undefined.
  function(){
    return
      {
        i=1
      };
  }
The reason is the interpreter will add a semi-colon at the end of return.
  function(){
    return;
      {
        i=1
      };
  }
6. + operator
+ as an operator has two meanings : can be used to add two numbers up or concatenate two strings.
  alert(1+10); // 11
  alert("1"+"10"); // 110
If one operand is string, the other operand is number, then the number will be converted to string automatically.
  alert(1+"10"); // 110
  alert("10"+1); // 101
This design increases the complexity of calculation.
7. NaN
NaN is a number, it means it overflows, it has some strange features:
  NaN === NaN; //false
  NaN !== NaN; //true
  alert( 1 + NaN ); // NaN
8. The difference between array and object
Since JavaScript's array is also object, so if we want to find whether an object is an array, it's very difficult. Douglas Crockford provides the following code.
  if ( arr &&
    typeof arr === 'object' &&
    typeof arr.length === 'number' &&
    !arr.propertyIsEnumerable('length')){
    alert("arr is an array");
  }
9. == and ===
When two values are different, it will auto cast.
  "" == "0" // false
  0 == "" // true
  0 == "0" // true
  false == "false" // false
  false == "0" // true
  false == undefined // false
  false == null // false
  null == undefined // true
  " \t\r\n" == 0 // true
So we recommend to use === whenever possible
10. The encapsulated object of primitive types
JavaScript has three primitive data types: string, number and boolean. They have respective value and function, it will create string object, number object and boolean object.
  new Boolean(false);
  new Number(1234);
  new String("Hello World");
Some mess up
  alert( typeof 1234); // number
  alert( typeof new Number(1234)); // object
Author : coffeescript Source : http://blog.csdn.net/coffeescript/article/details/8212541
Hard time learning javascript, are we ?