top of page

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

giselaf

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

Comments


Post: Blog2_Post
  • Facebook
  • Twitter
  • LinkedIn

©2019 by Gisela's Blog. Proudly created with Wix.com

bottom of page