I know how to do this, I just want a simpler way to implement this.
For example if I have the following list:
["This", "Is", "An", "Example"]
And the following string:
const str = "-abc"
The result I want is:
["This-abc", "Is-abc", "An-abc", "Example-abc"]
You can use the map function to achieve this.
const arr = ["This", "Is", "An", "Example"];
const strToConcat = "-abc";
const formattedArr = arr.map(str => str+strToConcat);
console.log(formattedArr);