Published
Edited
Oct 10, 2018
Insert cell
md`# Compose
${compose(x => x * 2, (x, y) => x + y)(10, 2)} // 24
`
Insert cell
function compose(...fns) {
return (...args) => {
return fns.reduceRight((result, fn) => [fn.call(null, ...result)], args);
};
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more