The indexOf() method of an array returns the first index number where a given value is in the array, or -1 if it doesn't exist.

    
    const pets = ['ant', 'bison', 'camel', 'duck', 'bison'];

    const petsIndexOfBison = pets.indexOf('bison');
    console.log(petsIndexOfBison);
    // 1

    const petsIndexOfFish = pets.indexOf('fish');
    console.log(petsIndexOfFish);
    // -1