题解 | #Array.map#

Array.map

http://www.nowcoder.com/practice/8300c998180c4ebbbd2a5aaeb7fbc77c

Array.prototype._map = function (fn){
    if(typeof fn !== "function") return ;
    let arr = [];
    for(let i = 0;i<this.length;i++){
      arr.push(fn(this[i],i,this))
    }
    return arr;
}
全部评论

相关推荐

青春运维少年不会梦到...:实习大王
点赞 评论 收藏
分享
09-17 19:25
已编辑
太原理工大学 游戏测试
叁六玖:公司名发我,我要这个HR带我打瓦
我的秋招日记
点赞 评论 收藏
分享
评论
3
收藏
分享

创作者周榜

更多
正在热议
更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务