ES6循环合并数组

let router = [
  {
    routerList:[]
  },
  {
    routerList:[]
  }
]
let routerList = []
for (let item of router) {
  routerList = [...routerList, ...item.routerList] // es6 合并数组
}

你可能感兴趣的:(ES6循环合并数组)