Skip to content

Commit 0bdf1af

Browse files
committedFeb 17, 2020
Playing with laziness
1 parent f1cbc3f commit 0bdf1af

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎javascript/lazy.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const sum = (a, b) => a + b;
2+
3+
const result = sum(1 + 2, 3);
4+
console.log(result);
5+
6+
const lazySum = (a, b) => () => a() + b();
7+
8+
const lazyResult = lazySum(() => 1 + 2, () => 3)();
9+
console.log(lazyResult);

0 commit comments

Comments
 (0)
Please sign in to comment.