Skip to content

Commit 16b7697

Browse files
committed
correct typo in Once Again example code
1 parent dcd0782 commit 16b7697

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

manuscript/markdown/Instances and Classes/recipes/named-once.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ The named once adds a property, `__once__`, to the context where the function is
7777

7878
var w = new Widget()
7979
.setVolume(...)
80-
.setDensity)(...)
80+
.setDensity(...)
8181
.setLength(...)
8282
.initialize();
8383
8484
If you later call `w.initialize()`, it won't be initialized again. You need a named `once`, because an ordinary `once` would be called once for every instance sharing the same prototype, whereas the named once will keep track of whether it has been run separately for each instance.
8585

86-
Caveat: Every instance will have a `__once__` property. If you later write code that iterates over every property, you'll have to take care not to interact with it.
86+
Caveat: Every instance will have a `__once__` property. If you later write code that iterates over every property, you'll have to take care not to interact with it.

0 commit comments

Comments
 (0)