GitHub 6248★

Multiply arguments

JavaScript version

const mul = (...args) => args.reduce((a, b) => a * b);

TypeScript version

const mul = (...args: number[]): number => args.reduce((a, b) => a * b);

Examples

mul(1, 2, 3, 4); // 24
Follow me on and to get more useful contents.