function.js
export const getApples = (fruits) => {
const needFruct = fruits
.filter(fruits => fruits.type === 'apple')
.map(fruits => fruits);
console.log(needFruct)
};
import { getApples } from './functions.js'
const fruits = [
{ type: 'apple', weight: 0.15 },
{ type: 'orange', weight: 0.21 },
{ type: 'banana', weight: 0.17 },
{ type: 'apple', weight: 0.25 },
{ type: 'pineapple', weight: 1.5 },
];
console.log(getApples(fruits)); // [ { type: 'apple', weight: 0.15 }, { type: 'apple', weight: 0.25 } ]
у меня вроде все получилось, но выдает ошибку. И не понимаю что за undefined