Closed rsgilbert closed 2 years ago
In a composition, each intermediate result is in fact a new function.
@getify I don't think so for this case.
// or the ES6 => form
var compose = (...fns) =>
result =>
[...fns].reverse().reduce(
(result,fn) =>
fn( result )
, result
);
The function that created result
has already completed and its this result we are bubbling up through successive functions.
Eh, ok. I don't think it matters much.
Yes, I promise I've read the Contributions Guidelines (please feel free to remove this line -- if you leave this line here, I'm going to assume you didn't actually read it).