Question: Consider the following JavaScript code segment. var sum = 0 ; var arr = new Array ( 7 , 1 , 6 , 9 ,

Consider the following JavaScript code segment.
varsum=0;
vararr=newArray(7,1,6,9,4);
for(vari=2;i<arr.length;i++){
sum+=arr[i];
}
document.write(sum);
What is displayed when this code is executed?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!