MCPcopy Create free account
hub / github.com/Faheem-Khan97/javascript-coding-problems-with-theory / compose

Function compose

compose&pipe/compose.js:27–27  ·  view source on GitHub ↗
(...fns)

Source from the content-addressed store, hash-verified

25// Compose way
26
27const compose = (...fns) => (value) => fns.reduceRight((acc,fn) => fn(acc), value)
28
29console.log(compose(subtract, multiply, sum)(5))

Callers 1

compose.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected