als antwoord op
Feels even more useful with reduce():
console.log([
x => x + 36,
x => `The answer is ${x}!`,
x => x.toUpperCase(),
].reduce((x, fn) => fn(x), 6));
// THE ANSWER IS 42!
Feels even more useful with reduce():
console.log([
x => x + 36,
x => `The answer is ${x}!`,
x => x.toUpperCase(),
].reduce((x, fn) => fn(x), 6));
// THE ANSWER IS 42!