Skip to content

Commit 2228b63

Browse files
committed
Changed to best practice of the this keyword
I've seen several people on IRC talk about readability. It seems there is some opinions that when chaining like this the `this` keyword is more readable then a dangling `@` symbol. I think it is a good idea to offer code readability in this project. Feel free to revert this commit if this is disputed. (Unable to open a PR from in the Github UI).
1 parent 67f38ca commit 2228b63

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

chapters/classes_and_objects/chaining.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ class CoffeeCup
2020
sugar: false
2121
strength: (newStrength) ->
2222
@properties.strength = newStrength
23-
@
23+
this
2424
cream: (newCream) ->
2525
@properties.cream = newCream
26-
@
26+
this
2727
sugar: (newSugar) ->
2828
@properties.sugar = newSugar
29-
@
29+
this
3030

3131
morningCup = new CoffeeCup()
3232

0 commit comments

Comments
 (0)