前端笔试题

1、有关输出的

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,

 

posted @ 2019-03-01 22:59  wenxuehai  阅读(266)  评论(0编辑  收藏  举报
//右下角添加目录