My answer is working, but at first I did total = undefined, after adding, it gave me NaN, from my understanding is we can give undefined to something which is not defined yet? so total is not defined yet, so why is NaN when every loop add to it?
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Challenge Information:
Basic JavaScript - Iterate Through an Array with a For Loop
Taking as an example the first iteration (i == 0). The myArr[i] is added to the previous value of total. What would be then the result of adding undefined and myArr[0]?