Currently in React, I am using array.map(function(text,index){}) to iterate through an array. But, how am I going to iterate through two arrays simultaneously u
array.map(function(text,index){})
You can't do this with built-in Array.prototype methods, but you can use something like this:
Array.prototype
function map2(arr1, arr2, func) { return arr1.map( (el, i) => { return func(el, arr2[i]); } ); }
(Of course, arr1 and arr2 are expected to have the same length)
arr1
arr2