Skip to content

Latest commit

 

History

History
8 lines (5 loc) · 540 Bytes

File metadata and controls

8 lines (5 loc) · 540 Bytes

Re-implementing some of JavaScript's built-in methods

To better understand the powerful reduce, map, and filter methods that help us write clean, functional code it can be helpful to re-implement them by hand.

Looking at the three together it becomes apparent that reduce is the workhorse of the group - making it simple to implement map and filter.

Also as a small bonus, it's nice to be able to convert built-in methods into functions that we can then use in function composition.