Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

ecmascript compose

//It is also called as nested function in ecmascript
const compose =(f,g) => (a) => f(g(a));
const sum = (num) => num + 1;
compose(sum,sum)(5)
//Answer is 7
 
PREVIOUS NEXT
Tagged: #ecmascript #compose
ADD COMMENT
Topic
Name
3+5 =