infinite loop using for loop code example
Example 1: javascript infinite for loop
var userInput;
var more;
userInput=prompt("Select number from 0 to 9","")
userInput=parseInt(userInput);
for (index=userInput;index < 0;index>9 ) {
document.write("Not in range");
}
document.write("Not in range");
Example 2: infinite loop using while
infinite loop using 'while'loop ----> while(1)