Let's say I have an array called users.
const users = ["userOne", "userTwo"];
Within an ES6 multi-line string, I would like to loop through the array and include the values of the users array within the multi-line string.
I have tried giving it a go using the following code snippet:
const data = `
Hello,
The following users exist within the users array:
- ${users.forEach((item) => item)},
`
The expected outcome I would like it something like this:
Hello,
The following users exist within the users array:
- userOne
- userTwo
What would I need to do to loop through the array and include the values within the string?