$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · hard · #129

Complete the function

// returns the sum of values using reduce with a typed accumulator
function sumValues(items: { v: number }[]): number {
  return items.reduce((acc, item) => acc + item.____, 0);
}
// sumValues([{v:1},{v:2}]) -> 3

Answer: v (also accepted: v, v())

Each item exposes its number on the property named v.
Play Problem Solving ▸