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
Are the both arrays of same length? You can do something like below if your intention is to combine both in some way.
array.map(function(text,index){
return text + ' ' + array2[index]
})
In your case:
var sentenceList = sentences.map(function(text,index){
return {text}
;
})
return (
{sentenceList}
);
Notice, How Icon src is being assigned. The idea is that access icons array with the same index to get a corresponding icon.