0

I am trying to concatenate 2 variables inside a map function, but I can't get it working. One depend of the other. I need to get the sequence of objects e.g. drink.strIngredient1, drink.strIngredient2, drink.strIngredient3... and so on.

const currentIndex = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

{ ingredientIndex.map((currentIndex) => (
   `${drink.strIngredient + currentIndex}`
))}

Does anyone know how to do it?

Kelson Batista
  • 406
  • 4
  • 25

0 Answers0