标签:var int ber span size comm pretty rip com
1. instanceof
var a = {
"name":‘suonidfahao‘,
"job": ‘webEnginner‘,
}
var b = [1,2,4,4];
console.log(a instanceof Array); //false
console.log(b instanceof Array); //true
2.Array.isArray(ie9以上支持)
Array.isArray([1, 2, 3]); // true
Array.isArray({foo: 123}); // false
Array.isArray(‘foobar‘); // false
Array.isArray(undefined); // false
3.原型链:constructor
var list = [1,2,3,4,5];
console.log(list.constructor === Array); //true
标签:var int ber span size comm pretty rip com
原文地址:https://www.cnblogs.com/duanzhange/p/9297937.html