Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const add3 = (x, y, z) => x + y + z
- const addTenPlusHundred = add3.bind(null, 10, 100)
- const xs = [1, 2, 3, 4, 5]
- const incrementedArray = xs.map(addTenPlusHundred)
- console.log(xs) // [ 1, 2, 3, 4, 5 ]
- console.log(incrementedArray) // [ 111, 112, 113, 114, 115 ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement