JavaScript currying 3 — Compose

Lukas Polak
1 min readSep 10, 2020

The compose function in the code below takes any number of functions, returns a function that takes the initial value, and then uses the reduceRight function to iterate right-to-left over each function f in functions argument and returns the accumulated value y. In other words, the compose function creates a pipeline of functions with the output of the function is connected to the input of the next function.

Originally published at https://dev.to on September 10, 2020.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response