Question: 5.Briefly describe how a while loop works. 6.What is a loop body? 7.What is a flag in JavaScript? 8.What does priming the loop mean? 9.

5.Briefly describe how a while loop works.

6.What is a loop body?

7.What is a flag in JavaScript?

8.What does "priming the loop" mean?

9.

What does the following code segment do?

var isSeven =false;

while ( isSeven==false ) {

var roll1=Math.floor(Math.random( )*6+1);

var roll2=Math.floor(Math.random( )*6+1);

if(roll1 + roll2 ==7) { isSeven = true; alert(roll1 +"--"+roll2); }

}

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 Databases Questions!