2012年8月12日 星期日

JavaScript小筆記

分類 :

  1. Primitive types, Object types
  2. Methods, Types
  3. Mutable types, immutable types
Number 
  1. 0, -0 (0 == -0, 1/0 != 1/-0)
  2. Infinity, -Infinity
  3. NaN
  Function

  function func(){
    this.x = 0;
    this.getX = function(){ return this.x; }
    this.setX = function(x){ this.x = x; }
  }
  var a = func(); //此時執行的this是javascript最頂層的global object
  var b = new func(); //此時執行的this是javascript最頂層的global object


      

    沒有留言:

    張貼留言