Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const car = (...a) => (...b) => {
- if (!b.length) return [...a].reduce((sum,el)=> sum+el)
- return car(...a,...b)
- }
- console.log(car(1,2,3)(4,5)(6)());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement