const fruits = ["apple", "banana", "cantaloupe", "blueberries", "grapefruit"];
const index = fruits.findIndex(fruit => fruit === "blueberries");
console.log(index); // 3
console.log(fruits[index]); // blueberries
Hi, came by this example here and wanted to know is there a way to use this format but instead of === blueberries, do something like !== blueberries in order to return grapefruit, cantaloupe, apple, banana. Thanks