В
Size: a a a
В
В
const data = [
{name:"Misha",age:10},
{name:"Masha",age:15},
{name:"Sereja",age:11},
{name:"Ksusha",age:15},
]
const reducer = (accumulator, currentValue) => {
if(accumulator[0] === undefined || accumulator[0].age < currentValue.age){
return [currentValue];
}else if (accumulator[0].age === currentValue.age){
return [...accumulator,currentValue];
}else{
return accumulator;
}
}
console.log(data.reduce(reducer))
В
IB
В
IB
В
А
function maxAge(item, index, array){
let max = array.map(item => item.age);
let curr = Math.max(...max);
return item.age == curr;
}
console.log(person.filter(maxAge))
а так вар норм?AP
function maxAge(item, index, array){
let max = array.map(item => item.age);
let curr = Math.max(...max);
return item.age == curr;
}
console.log(person.filter(maxAge))
а так вар норм?А
AP
А
А
А
🎈(
function maxAge(item, index, array){
let max = array.map(item => item.age);
let curr = Math.max(...max);
return item.age == curr;
}
console.log(person.filter(maxAge))
а так вар норм?MK
function maxAge(item, index, array){
let max = array.map(item => item.age);
let curr = Math.max(...max);
return item.age == curr;
}
console.log(person.filter(maxAge))
а так вар норм?А
🎈(
А
AP