top of page
  • giselaf

Friday For this activity you will predict will appear in the console log.

Updated: Nov 12, 2019

I.

ex. 1

var x = 0;

while (x<5){

console.log(x);

x=x+1;

}

The console will print out x as the numbers 0,1,2,3, and 4 because the while is adding +1 every time until the statement is not true x<5




ex 2:

var x = 0;

var y = 5;

while (x<5){

console.log(x+y);

x=x+1;


The console will print out numbers 5,6,7,8 and 9


0 views0 comments

Recent Posts

See All
Post: Blog2_Post
bottom of page