Is there a way to automatically assign objects from an array to variables based on their corresponding index?
Here is what I attempted:
response.forEach((el, i, )=>{
let nameProduct[i] = ` the name of product : ${response[i].nameProduct}`;
console.log(nameProduct[i]);
});
Unfortunately, this approach did not work as expected.