Does using ForEach with push to create an output array in javascript Anti-Pattern? Or is it better to use Map?
const result = [];
arr.forEach(element => {
result.push(element.name)
})
Does using ForEach with push to create an output array in javascript Anti-Pattern? Or is it better to use Map?
const result = [];
arr.forEach(element => {
result.push(element.name)
})