showing results for - "ecmascript compose"
Lennart
14 Jan 2019
1//It is also called as nested function in ecmascript
2const compose =(f,g) => (a) => f(g(a));
3const sum = (num) => num + 1;
4compose(sum,sum)(5)
5//Answer is 7