- 4
can we do infinite loop with loop
yes by calling main in main
5 Réponses
+ 13
But it isn't loop.
It is called RECURSION.
For infinite loops just write:
while(true)
That's it! Everything you need for infinite loop.
Also recursion will cause 'StackOverflow' exception or something else in different languages.
+ 13
@Nicola
Your have so much logical issues, but it will work.
Just while(1) will be fine.
So x = 1 will set x to 1, not compare. Just write == or while(true)
+ 11
+ 1
Yes we can :)
+ 1
x=1;
while(x=1){
console.log(x);
}
js example :)