File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
1-js/06-advanced-functions/09-call-apply-decorators Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -36,11 +36,11 @@ function cachingDecorator(func) {
36
36
37
37
slow = cachingDecorator (slow);
38
38
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
41
41
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
44
44
```
45
45
46
46
In the code above ` cachingDecorator ` is a * decorator* : a special function that takes another function and alters its behavior.
You can’t perform that action at this time.
0 commit comments