You are viewing a single comment's thread. Return to all comments →
function simpleArraySum(ar) { var ans = 0; for(i = 0; i < ar.length; i++){ ans += ar[i]; } return ans; }
In JS is giving me runtime error, but a friend tried with same code and passed!!!
Seems like cookies are disabled on this browser, please enable them to open this website
Simple Array Sum
You are viewing a single comment's thread. Return to all comments →
function simpleArraySum(ar) { var ans = 0; for(i = 0; i < ar.length; i++){ ans += ar[i]; } return ans; }
In JS is giving me runtime error, but a friend tried with same code and passed!!!