[Home] >  Number >  Calculate the division of arguments

Calculate the division of arguments

JavaScript version

const division = (...args) => args.reduce((a, b) => a / b);

TypeScript version

const division = (...args: number): number => args.reduce((a, b) => a / b);

Examples

division(1, 2, 3, 4); // 0.04166666666666666