Skip to content

Commit 0c744e5

Browse files
committed
Merge pull request coffeescript-cookbook#120 from pbihler/master
Fix class-internal reference to class attribute
2 parents 70b841c + 3442e83 commit 0c744e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chapters/classes_and_objects/class-methods-and-instance-methods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Songs
2020
@_titles
2121

2222
constructor: (@artist, @title) ->
23-
Songs._titles++
23+
@constructor._titles++ # Refers to <Classname>._titles, in this case Songs.titles
2424

2525
Songs.get_count()
2626
# => 0

0 commit comments

Comments
 (0)