Home > other >  Node JS while true loop multiply numbers (a basic counter)
Node JS while true loop multiply numbers (a basic counter)

Time:02-15

while(true){
var x = 0
console.log(x 1)}

I want a basic counter. In a while true loop it needs to start from 0 and add 1 every time. How can I do that ? The loop needs to stop when it reaches to a number, lets say 50.

CodePudding user response:

var x = 0
while(x < 50){
console.log(x  )
}

  • Related