const juxt = (…fns) => (…args) => […fns].map(fn => […args].map(fn));
juxt(
x => x + 1,
x => x - 1,
x => x * 10
)(1, 2, 3); // [[2, 3, 4], [0, 1, 2], [10, 20, 30]]
juxt(
s => s.length,
s => s.split(' ').join('-')
)(''); // [[18], ['30-seconds-of-code']]
Функции
JavaScript