const array = [1, 2, 3, 4, 5]; // checks whether an element is even function validacion(element, index, array) { const result = element % 2 === 0; array[index] = 0; return result; } console.log(array.some(validacion)); // true console.log(array); // Array [0, 0, 3, 4, 5]