- Primitive types, Object types
- Methods, Types
- Mutable types, immutable types
Number
- 0, -0 (0 == -0, 1/0 != 1/-0)
- Infinity, -Infinity
- 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
沒有留言:
張貼留言