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
You could also use reduce to get the desired outcome:
reduce
var arr1 = ['a', 'b', 'c']; var arr2 = [1, 2, 3]; arr1.reduce((acc, current, index) => { console.log(current, arr2[index]) return [...acc, current, arr2[index]] }, []) // a 1 // b 2 // c 3 // returns ["a", 1, "b", 2, "c", 3]