Skip to content

sub JavaScript

Returns after subtracting all n arguments of numbers or the values of a single array of numbers.

Parameters

  • numbers::...number[]

Returns

number

Examples

javascript
sub(10, 1, 5); // Returns 4
sub([1, 2, 3, 4]); // Returns -8

Released under the MIT License