Skip to content

Commit 434e637

Browse files
authored
For the completeness of example.
because after all, ```let result1 = process(obj); // calculated``` would be ```undefined```. Also using this opportunity, wanted to say thanks to creator and editors of this great tutorial!
1 parent 5dff42b commit 434e637

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

1-js/05-data-types/08-weakmap-weakset/article.md

+2
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ function process(obj) {
182182
let result = /* calculations of the result for */ obj;
183183

184184
cache.set(obj, result);
185+
return result;
185186
}
186187

187188
return cache.get(obj);
@@ -221,6 +222,7 @@ function process(obj) {
221222
let result = /* calculate the result for */ obj;
222223

223224
cache.set(obj, result);
225+
return result;
224226
}
225227

226228
return cache.get(obj);

0 commit comments

Comments
 (0)