I'm trying to add the values of two arrays in javascript eg. [1,2,1] + [3,2,3,4]
The answer should be 4,4,4,4 but I'm either getting 4,4,4 or 4,4,4,NaN if I change the 1st array length to 4.
I know a 4th number needs to be in the 1st array, but i can't figure out how to tell javascript to make it 0 rather then undefined if there is no number.