Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. const double = x => x * 2
  2. const getLength = string => string.length
  3.  
  4. const map = (collection, fn) => collection.map(fn)
  5.  
  6. const messages = ['Hello', 'Bye']
  7.  
  8. const doubleLengths = map(map(messages, getLength), double)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement