Pure functions are easier to read and understand. All the function’s dependencies are in its definition and are therefore easier to see. Pure functions also tend to be small and do one thing. They don’t use
this, a constant source of confusion.
Chaining is a technique used to simplify code where multiple methods are applied to an object one after another.
Let’s look and compare the two styles: imperative and functional. In the functional style, I use the basic toolbox for list operations
map() and chain them together.
I took the case of a collection of tasks. A task has an
... read the whole story at medium.freecodecamp.org.
id, description (