xxxxxxxxxx
const result = someArray.find(isNotNullNorUndefined);
xxxxxxxxxx
const array = [2, 4, 6, 8, 2, 4, 6, 8];
// Define the value to search for
const searchValue = 6;
// Find the first occurrence of the value in the array
const index = array.indexOf(searchValue);
if (index > -1) {
console.log(`The first occurrence of ${searchValue} is at index ${index}`);
} else {
console.log(`${searchValue} was not found in the array`);
}