Skip to content

Commit ebd0d11

Browse files
authored
Merge pull request #2485 from notapatch/pr-call-apply-decorators-clearer-comments
Clearer CachingDecorator comments
2 parents a5523ad + 18534d3 commit ebd0d11

File tree

1 file changed

+4
-4
lines changed
  • 1-js/06-advanced-functions/09-call-apply-decorators

1 file changed

+4
-4
lines changed

1-js/06-advanced-functions/09-call-apply-decorators/article.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ function cachingDecorator(func) {
3636

3737
slow = cachingDecorator(slow);
3838

39-
alert( slow(1) ); // slow(1) is cached
40-
alert( "Again: " + slow(1) ); // the same
39+
alert( slow(1) ); // slow(1) is cached and the result returned
40+
alert( "Again: " + slow(1) ); // slow(1) result returned from cache
4141

42-
alert( slow(2) ); // slow(2) is cached
43-
alert( "Again: " + slow(2) ); // the same as the previous line
42+
alert( slow(2) ); // slow(2) is cached and the result returned
43+
alert( "Again: " + slow(2) ); // slow(2) result returned from cache
4444
```
4545

4646
In the code above `cachingDecorator` is a *decorator*: a special function that takes another function and alters its behavior.

0 commit comments

Comments
 (0)