The Merger Sum

MediumAcc. 92.6%
+25 XP 10

Hybrid Accumulation

Calculate the combined total of every number in two different arrays.

The Assignment

Your function receives arr1 and arr2.

  1. Iterate through arr1 and accumulate.
  2. Iterate through arr2 and accumulate.
  3. Print the massive total.

01EXAMPLE 1

Inputarr1=[1], arr2=[2, 3]
Output6

Explanation: 1 + 2 + 3 = 6.

Constraints

  • Handle empty arrays in either position.
ArraysLoops
JavaScript
Loading...
1 Hidden

Input Arguments

arr1[1]
arr2[2,3]

Expected Output

6

Click RUN to test your solution