Skip to content

Commit 38d0dee

Browse files
committed
Merge pull request BonsaiDen#320 from shakvaal/patch-2
Explicitly show that code fails
2 parents 6e85078 + 8a9e032 commit 38d0dee

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)