Skip to content

Commit 480d217

Browse files
committed
Show functor type
1 parent f2d60e6 commit 480d217

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

JavaScript/6-functor.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ const add = x => {
88
};
99
f.map = fn => fn(x);
1010
return f;
11-
}
11+
};
1212

1313
const a1 = add(5);
1414
const a2 = a1(2);
1515
const a3 = a2(3);
1616
const a4 = a1(1);
1717
const a5 = a2(10);
18-
a5.map(console.log);
18+
19+
const print = x => console.log(x);
20+
[a3, a4, a5].map(x => typeof(x)).map(print);

0 commit comments

Comments
 (0)