+ 1
for loop code is returning me undefined.
My For Loop Code is returning me undefined for some reason I don't know at all. I know I am doing something wrong here. So, Please help me and please me an explanation too. https://code.sololearn.com/W50pjES7J2Wr/?ref=app
2 Respostas
+ 1
Array Index starts from 0 so max index is array.length-1
So use condition a<num.length instead of a<=num.length
+ 2
Thanks it's solved now.