map()
JS · Arraysarr.map(callback(element, index, array))const prices = [10, 25, 50];
const withTax = prices.map(p => +(p * 1.08).toFixed(2));
console.log(withTax);[10.8, 27, 54]Note map() returns a new array of the same length. If you do not need the return value, use forEach() instead.