//定义 array.map(function(item,index,arr), thisValue)
item 为当前元素 必填, index是当前元素索引值,选填,arr是当前元素所属数组,thisValue可选。对象作为该执行回调时使用,传递给函数,用作 "this" 的值。如果省略了 thisValue,或者传入 null、undefined,那么回调函数的 this 为全局对象;
map不该变数组而是返回一个新数组
map() 不会对空数组进行检测
posted on 2019-07-01 21:03 和平的蛋蛋桑 阅读(296) 评论(0) 收藏 举报
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3