number string boolenan undefined function Object typeof typeof typeof function(){}->返回结果string
局限性javascript
局限性java
(1 instaceof Number) //false (true instaceof Boolean) //false (new Number(1) instaceof Number) //true
一、字面量建立出来的结果和实例建立出来的结果是有必定区别的只有实例建立出来的对象才是标准的对象函数
二、实例prototype
var arr = []; (arr instaceof Array)//true (arr instaceof Object)//true (fn instaceof Function) //true (fn instaceof Object) // true
var arr = []; console.log(arr.constructor===Array);
console.log(typeof 12); function dd (callbak){ callbak && callbak(); } var obj = [12,32]; console.log(obj instanceof Array); console.log(Object.prototype.toString.call([])); console.log(Object.prototype.toString.call({})); console.log(Object.prototype.toString.call(1)); console.log(Object.prototype.toString.call("sff")); console.log(Object.prototype.toString.call(new Date)); console.log(Object.prototype.toString.call(/\d/)); console.log(Object.prototype.toString.call(null)); console.log(Object.prototype.toString.call(undefined));