¡Es mi primera pregunta aquí!) ¿Por qué esta función devuelve 'indefinido'? Gracias
const arr = [1, 1, 2, 1, 2, 1] selector = function (arr) { let counter = 0; arr.forEach(element => { if (element == 2) { counter += 1; } }); }