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.
- Iterate through
arr1and accumulate. - Iterate through
arr2and accumulate. - Print the massive total.
01EXAMPLE 1
Input
arr1=[1], arr2=[2, 3]Output
6Explanation: 1 + 2 + 3 = 6.
Constraints
- Handle empty arrays in either position.
ArraysLoops
JavaScriptSystem handles I/O — write your function only
Loading...
1 Hidden
Input Arguments
arr1[1]
arr2[2,3]
Expected Output
6
Click RUN to test your solution