Skip to content

Commit 5698542

Browse files
committed
Rename examples
1 parent eceb86d commit 5698542

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed
File renamed without changes.
File renamed without changes.

JavaScript/6-wrapper.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
3+
const logable = fn => (...args) => {
4+
const res = fn(...args);
5+
console.log(`Call: ${fn.name}(${args.join(', ')}) Result: ${res}`);
6+
return res;
7+
};
8+
9+
// Usage
10+
11+
const sum = (a, b) => (a + b);
12+
13+
const wrapped = logable(sum);
14+
console.log(wrapped(3, 5));

0 commit comments

Comments
 (0)