Image by Joshua Hoehne from Unsplash
DESCRIPTION
Method chaining is a helpful pattern to learn in programming. It complies with the functional, declarative approach and reduces repetition.
Chain them all
Summary
- Method chaining is a really good pattern for avoiding repetition and making your code more readable.
- It plays well with functional programming and is often used in JavaScript.
- Each of the methods needs to return something in order to call another method on it. Hence the chaining name.