题解 | #Array.map#
Array.map
https://www.nowcoder.com/practice/8300c998180c4ebbbd2a5aaeb7fbc77c
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <style> /* 填写样式 */ </style> </head> <body> <!-- 填写标签 --> <script type="text/javascript"> // Array.prototype._map = function(Fn) { if(typeof Fn != 'function') return //进行循环 const newArr = [] for(let i = 0;i < this.length;i++){ newArr[i] = Fn(this[i]) } return newArr } </script> </body> </html>