console.log(Array.isArray(Array.prototype)); // true Array.prototype 自己也是一个 Array。 console.log(Array.isArray(Person.prototype)); //false Person.prototype是一个对象
let a =['1','2','3'].map(parseInt) console.log(a); //[1, NaN, NaN] //上面的代码实际上等于: ['1','2','3'].map(parseInt(val,index)) //parseInt(string, radix) 的参数radix必须介于2~36之间,并且字符串string中的数字不能大于radix才能正确返回数字结果值。 //parseInt('1',0) = 1, //parseInt('2',1) = NaN, //parseInt('3',2) = NaN,