Consider the following code snippet:
const fruits = ['apple', 'banana', 'cherry', 'date'];
const foundIndex = fruits.findIndex(fruit => fruit === 'cherry');
console.log(foundIndex);
What will be the output of the console.log statement?
Consider the following code snippet:
const fruits = ['apple', 'banana', 'cherry', 'date'];
const foundIndex = fruits.findIndex(fruit => fruit === 'cherry');
console.log(foundIndex);
What will be the output of the console.log statement?