Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
JavaScript - While Loop Example
#1
Code:
let n = 0;
let x = 0;

while(n < 30)
  {
    n++;
    x += n;
    document.write("The value of n is " + n + "<br>");
    document.write("The value of x is " + x + "<br>");
  }
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  JavaScript - For Loop Example Qomplainerz 0 357 04-04-2023, 07:51 AM
Last Post: Qomplainerz
  JavaScript - Do...While Loop Example Qomplainerz 0 329 04-04-2023, 07:51 AM
Last Post: Qomplainerz

Forum Jump:


Users browsing this thread: 2 Guest(s)