📜  一个js中的两个数组 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:04:21.046000             🧑  作者: Mango

代码示例2
//If you find something better, please, let me know :(
let arr = [[1,2],[3,4],[5,6]]
let [arr1, arr2] = [[], []]
arr.map((e) => { arr1.push(e[0]); arr2.push(e[1]) })
console.log(arr1,arr2) // [[1,3,5],[2,4,6]]