1. let arr = [1, 32, 41, 2, 1312, 41, 1, 321]
    2. // map方法是返回原来的数组
    3. Array.prototype._map = function (fn) {
    4. if (typeof fn !== "function") {
    5. throw new TypeError('Not Function')
    6. }
    7. let res = []
    8. for (let i of this) {
    9. fn(i) && res.push(fn(i))
    10. }
    11. return res
    12. }
    13. console.log(arr._map(x => x * 2));