You are viewing a single comment's thread. Return to all comments →
This code written is Js is working in vs code but in hackerrank it is showing undefined can anyone help me out...
let sum = 0; for (let i = 0; i < ar.length; i++) { // console.log(ar[i]); sum = sum + ar[i] } console.log(sum)
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 →
This code written is Js is working in vs code but in hackerrank it is showing undefined can anyone help me out...
let sum = 0; for (let i = 0; i < ar.length; i++) { // console.log(ar[i]); sum = sum + ar[i] } console.log(sum)