Array: [1, 2, 3, 4]
Result: ["foo1", "foo2", "foo3", "foo4"]
Array.prototype.map()
Keep original arrayconst originalArr = ["Iron", "Super", "Ant", "Aqua"];
const modifiedArr = originalArr.map(name => `${name}man`);
console.log( "Original: %s", originalArr );
console.log( "Modified: %s", modifiedArr );
_x000D_
Array.prototype.forEach()
Override original arrayconst originalArr = ["Iron", "Super", "Ant", "Aqua"];
originalArr.forEach((name, index) => originalArr[index] = `${name}man`);
console.log( "Overridden: %s", originalArr );
_x000D_