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

What goes in the blank?

// sum the array into one value
const total = nums.____((a, b) => a + b, 0);

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

reduce() folds an array down to a single value.
Play Problem Solving ▸