摘要:
1.使用Array.prototype.slice.call(); Array.prototype.slice.call({ 0:"yeluosen", 1:12, 2:true, length:3 }); //["yeluosen", 12, true] 2.使用[].slice.call() [ 阅读全文
posted @ 2019-01-26 21:59
柠萌加醋
阅读(51)
评论(0)
推荐(0)
摘要:
1.forEach():没有返回值,只是针对每个元素调用func 简单来说,就是将数组中的每个值,依次进行遍历,执行功能函数 如果只需对数组元素进行操作,不需返回任何值时,适用 eg.例如依次输出数组元素的值 2.map():返回一个新的Array,每个元素为调用func的结果 是将每个元素进行fu 阅读全文
posted @ 2019-01-26 21:33
柠萌加醋
阅读(319)
评论(0)
推荐(0)