¿Qué valor se imprime al ejecutar el siguiente código?
let max = -Infinity;
const arr = [-2, -1, 0, 1, 2];
arr.forEach(item => {
if (item > max) max = item;
});
console.log(max);
¿Qué valor se imprime al ejecutar el siguiente código?
let max = -Infinity;
const arr = [-2, -1, 0, 1, 2];
arr.forEach(item => {
if (item > max) max = item;
});
console.log(max);