1
CismonX 2021-05-04 02:25:24 +08:00 via iPhone
ES6 有 destructuring assignment
ES2019 有 Array.prototype.flat() |
2
pabupa 2021-05-04 06:25:58 +08:00 via Android
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Iterators_and_Generators
不知道标准库有没有,但是既然有上面文档的支持,自己实现一个也不难,,,, |
3
hyrious 2021-05-04 08:34:19 +08:00 via Android
for (const [a,b,c,d] of list)
const zip = (a, b) => a.map((e, i) => [e, b[i]]) for (const [a, b] of zip(list1, list2)) |
4
hxse 2021-05-04 14:29:32 +08:00
array=[[1 ,2], [3, 4]]
for ([k, v] of array){ console.log(k, v) } --- 1 2 3 4 |
5
maloneleo88 OP |