Javascript ES6 - map multiple arrays

后端 未结 3 1685
甜味超标
甜味超标 2021-01-07 22:23

Is there a feature in JavaScript 6 that allows to map over multiple arrays ?

Something like a zipper :

 var myFn = function (a, b) { console.log(a, b         


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-07 23:18

    Unfortunately, no. What you are looking for is commonly called zip or zipWith. See lodash's implementation for a reference: https://lodash.com/docs#zipWith

提交回复
热议问题