Skip to content

Commit fea379d

Browse files
authored
Use correct instance names passed to the functions in code examples
The code examples refer to the instance passed as the first parameter to the function. A few of them do not use the correct instance names. This update fixes it to avoid confusion to the readers.
1 parent 1fe315f commit fea379d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

js/red-javascript-style-guide/why-disallow-class.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ const multiverseHero = createMultiverseHero({ name: `Jace` });
115115

116116
// add methods
117117
const changeUniverse = (multiverseHero, universe) => {
118-
hero.concentrationLevel -= 20;
119-
hero.currentUniverse = universe;
118+
multiverseHero.concentrationLevel -= 20;
119+
multiverseHero.currentUniverse = universe;
120120
};
121121

122122
// change existing
123123
const moveMultiverseHero = (multiverseHero, position) => {
124124
// do something before or after
125125
moveHero(multiverseHero, position);
126-
hero.concentrationLevel -= 1;
126+
multiverseHero.concentrationLevel -= 1;
127127
};
128128

129129
changeUniverse(multiverseHero, 2);

0 commit comments

Comments
 (0)