// find index of array item; test values using a function const arr = ['A','B','C']; const index = arr.findIndex((item) => item === 'B'); // index == 1