Guest User

Untitled

a guest
Jun 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. const list = [1,2,3,4,5,6,7,8,9,10]
  2.  
  3. // Soma dos quadrados dos impares de 1 a 10
  4. const result = list
  5. .filter(i => i % 2 === 1)
  6. .map(i => i*i)
  7. .reduce( (acc, cur) => acc + cur )
  8.  
  9. console.log(result)
Add Comment
Please, Sign In to add comment