Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const persons = [
- { name: 'lady', age: 24 },
- { name: 'thembeka', age: 34 },
- { name: 'thembeka', age: 37 }
- ]
- const f = person => person.name.length <= 6;
- const g = person => person.age ** 2;
- const h = person => person.age % 2 === 1;
- const i = (ages, person) => [...ages, person.age];
- display.log(persons.reduce(i, []))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement