一、Array常用操作
参考:https://segmentfault.com/a/1190000018448643#articleHeader2
const array = [1, 2, 3]
let result = []
1、forEach 遍历循环
array.forEach(item => {
result.push(item)
})
2、map 映射
array.map(item => {
result.push(item)
})
参考:https://segmentfault.com/a/1190000018448643#articleHeader2
const array = [1, 2, 3]
let result = []
1、forEach 遍历循环
array.forEach(item => {
result.push(item)
})
2、map 映射
array.map(item => {
result.push(item)
})
本文标题:ES6方法总结
本文链接:https://www.haomeiwen.com/subject/ajzvjctx.html
网友评论