DEV Community

Discussion on: 4 JavaScript things you need to know

Collapse
 
rbauhn profile image
Robin Bauhn • Edited

Nice article, although I would suggest changing compose to:

const compose = (...funcs) => value => {
    let output = value
    for (func of  funcs){
        output = func(output)
    }
    return output
}
Enter fullscreen mode Exit fullscreen mode