File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -736,13 +736,12 @@ class Human extends Mammal {
736
736
737
737
### Use method chaining
738
738
Against the advice of Clean Code, this is one place where we will have to differ.
739
- It has been argued that method chaining is unclean and violates the (Law of Demeter)
740
- [ https://en.wikipedia.org/wiki/Law_of_Demeter ] . Maybe it's true, but this pattern
741
- is very useful in JavaScript and you see it in many libraries such as jQuery and
742
- Lodash. It allows your code to be expressive, and less verbose. For that reason,
743
- I say, use method chaining and take a look at how clean your code will be.
744
- In your class functions, simply return ` this ` at the end of every function, and
745
- you can chain further class methods onto it.
739
+ It has been argued that method chaining is unclean and violates the [ Law of Demeter] ( https://en.wikipedia.org/wiki/Law_of_Demeter ) .
740
+ Maybe it's true, but this pattern is very useful in JavaScript and you see it in
741
+ many libraries such as jQuery and Lodash. It allows your code to be expressive,
742
+ and less verbose. For that reason, I say, use method chaining and take a look at
743
+ how clean your code will be. In your class functions, simply return ` this ` at
744
+ the end of every function, and you can chain further class methods onto it.
746
745
747
746
** Bad:**
748
747
``` javascript
You can’t perform that action at this time.
0 commit comments