Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript compose function

const compose = (...funcs) => args => funcs.reduceRight((arg, fn) => fn(arg), args);

// Or if you like in ES5
function compose(...funcs) 
{
	return function(args)
    {
    	return funcs.reduceRight( (arg, fn) => fn(arg), args);
    }
}
 
PREVIOUS NEXT
Tagged: #javascript #compose #function
ADD COMMENT
Topic
Name
1+7 =