I have a list of items that I would like to iterate through, adding the value of i to each to find the next set of information.
Example: You can concatenate the string "req.body.item" + i + "Title" to get the result "req.body.item0Title"
But can you do that with the object req.body.item + i + Title? I keep getting "Title isn't defined or something similar.
for (i = 0; i < 3; i++) {
console.log(req.body.item + i + Title);
}
Ideally, I'd love to see the console.log output to read the req.body reference of, item0Title, item1Title, and item2Title.
Thanks team.