Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. const persons = [
  2. { name: 'lady', age: 24 },
  3. { name: 'thembeka', age: 34 },
  4. { name: 'thembeka', age: 37 }
  5. ]
  6.  
  7. const f = person => person.name.length <= 6;
  8. const g = person => person.age ** 2;
  9. const h = person => person.age % 2 === 1;
  10. const i = (ages, person) => [...ages, person.age];
  11.  
  12. display.log(persons.reduce(i, []))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement