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) {
3636
3737slow = 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
4646In 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