Skip to content

Commit 3442e83

Browse files
author
pbihler
committed
Replaced Songs._titles++ by @constructor._titles
DRY principle applied by removing the reference to the explicit classname within a class itself
1 parent 70b841c commit 3442e83

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)