Skip to content

Commit b3f0cc7

Browse files
author
hoangNam
committed
- Assign ClubberTroll to another variable in README
1 parent 86e9c66 commit b3f0cc7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

decorator/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ troll.attack(); // The troll tries to grab you!
104104
troll.fleeBattle(); // The troll shrieks in horror and runs away!
105105

106106
// change the behavior of the simple troll by adding a decorator
107-
troll = new ClubbedTroll(troll);
108-
troll.attack(); // The troll tries to grab you! The troll swings at you with a club!
109-
troll.fleeBattle(); // The troll shrieks in horror and runs away!
107+
Troll clubbedTroll = new ClubbedTroll(troll);
108+
clubbedTroll.attack(); // The troll tries to grab you! The troll swings at you with a club!
109+
clubbedTroll.fleeBattle(); // The troll shrieks in horror and runs away!
110110
```
111111

112112
## Applicability

0 commit comments

Comments
 (0)