Answers for "indexof number javascript"

7

js get index of item in array

array.indexOf("item");
Posted by: Guest on May-13-2020
0

indexof js

const fruits = ["apple", "banana", "cantaloupe", "blueberries", "grapefruit"];

const index = fruits.findIndex(fruit => fruit === "blueberries");

console.log(index); // 3
console.log(fruits[index]); // blueberries
Posted by: Guest on June-03-2021

Code answers related to "indexof number javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language