What will be shown when executing the following code?
const fruits = [
{ type: 'apple', color: 'red' },
{ type: 'banana', color: 'yellow' }
];
const selected = fruits.filter(fruit => fruit.color === 'red');
console.log(selected[0].type);
What will be shown when executing the following code?
const fruits = [
{ type: 'apple', color: 'red' },
{ type: 'banana', color: 'yellow' }
];
const selected = fruits.filter(fruit => fruit.color === 'red');
console.log(selected[0].type);