Skip to content

Commit 8a9e032

Browse files
committed
Explicitly show that code fails
`foo.hack` text makes it more difficult to understand at once when you are a quick reader and check code before description.
1 parent e78568f commit 8a9e032

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/en/function/closures.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ Since it is not possible to reference or assign scopes in JavaScript, there is
3636
interact with it is via the two closures.
3737

3838
var foo = new Counter(4);
39-
foo.hack = function() {
39+
foo.hackFail = function() {
4040
count = 1337;
4141
};
4242

4343
The above code will **not** change the variable `count` in the scope of `Counter`,
44-
since `foo.hack` was not defined in **that** scope. It will instead create - or
44+
since `foo.hackFail` was not defined in **that** scope. It will instead create - or
4545
override - the *global* variable `count`.
4646

4747
### Closures Inside Loops

0 commit comments

Comments
 (0)