Guest User

Untitled

a guest
Dec 10th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. const list = [1, 2, 3];
  2.  
  3. function double(i) {
  4. return i * 2;
  5. }
  6. function map (arr, fn) {
  7. return arr.map(fn);
  8. }
  9. map(list, double); //[2, 4, 6]
Add Comment
Please, Sign In to add comment