题解 | #Array.map#

Array.map

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

// Fn大小写
{"html":"<!DOCTYPE html>\n<html>\n\n<head>\n    <meta charset=\"UTF-8\">\n    <style>\n       /* 填写样式 */\n    </style>\n</head>\n\n<body>\n    <!-- 填写标签 -->\n    <script type=\"text/javascript\">\n        // \n        Array.prototype._map = function(Fn) {\n     if (typeof Fn !== 'function') return\n    let arr = this\n    let arrar = new Array\n    for (let i = 0; i < arr.length; i++) {\n        arrar.push(Fn(this[i], i, this))\n\n    }\n    return arrar\n}\n\n    </script>\n</body>\n\n</html>","css":"","js":""}

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务