For Loop Summarizing

Exercise 1

Compute the sum of the numbers in the array

Examples:

  • numbers: [2,-3,4,-6] -> -3
  • numbers: [-2,0,-20,-300] -> -322
  • numbers: [12,4,3] -> 19
export default function computeSum(numbers) {
  // TODO
}

Open browser consoleTests

Exercise 2

Given an array of strings, return the total number of characters in all strings combined.

Examples:

  • texts: ['a','b','c'] -> 3
  • texts: ['abc','def','ghi'] -> 9
  • texts: ['', '12 ', ' 34'] -> 6
export default function getTotalCharacters(texts) {
  // TODO
}

Open browser consoleTests