$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · medium · #228

What goes in the blank?

// total of every number in the array
const total = nums.____((a, b) => a + b, 0);

Answer: reduce (also accepted: reduce, reduce())

reduce() folds the array into one value, starting from the 0 seed.
Play Problem Solving ▸