“Найти индекс, используя функцию стрелки” Ответ

Найти индекс, используя функцию стрелки

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

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

console.log(index); // 3
console.log(fruits[index]); // blueberries
Breakable Bug

Найти индекс, используя функцию стрелки

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

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

console.log(index); // 3
console.log(fruits[index]); // blueberries
Talented Tiger

Ответы похожие на “Найти индекс, используя функцию стрелки”

Вопросы похожие на “Найти индекс, используя функцию стрелки”

Больше похожих ответов на “Найти индекс, используя функцию стрелки” по JavaScript

Смотреть популярные ответы по языку

Смотреть другие языки программирования