Category
First summand
Second summand
The sum of a
and b
Reducers
const array = [1, 2, 3];
array.reduce(sum); // 6
Category
Calculate the sum of 2 bigint
s.
Meant to be used with Array.prototype.reduce
.
Time complexity: O(1)
Space complexity: O(1)
First summand
Second summand
The sum of a
and b
Reducers
const array = [1n, 2n, 3n];
array.reduce(sum); // 6n
Calculate the sum of 2
number
s. Meant to be used withArray.prototype.reduce
.Time complexity: O(1)
Space complexity: O(1)