Problem
pipe(...fns)(x)applies the functions from left to right.compose(...fns)(x)applies them from right to left.
function pipe(...fns) {
// your code
}
function compose(...fns) {
// your code
}
Asked at Tekion
JavaScript interview practice: pipe runs functions left-to-right; compose runs them right-to-left, threading the result through each.
pipe(...fns)(x) applies the functions from left to right.compose(...fns)(x) applies them from right to left.function pipe(...fns) {
// your code
}
function compose(...fns) {
// your code
}
Unlock the in-browser editor, test cases, and model solution with Mentoxis Premium.
Unlock with Premium