Skip to content

Commit 89ee8cd

Browse files
committed
Write Higher Order Arrow Functions
1 parent f0b9249 commit 89ee8cd

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,4 +1123,15 @@ const increment = (function() {
11231123
})();
11241124

11251125
console.log(increment(5,2));
1126-
console.log(increment(5));
1126+
console.log(increment(5));
1127+
1128+
// Write Higher Order Arrow Functions
1129+
1130+
const sum = (function() {
1131+
return function sum(x, y, z){
1132+
const args = [x, y, z];
1133+
return args.reduce((a,b) => a+b, 0);
1134+
};
1135+
})();
1136+
1137+
console.log(sum(1,2,3));

0 commit comments

Comments
 (0)