The JavaScript for loop is used for the codes that are desired to work until the number of repetitions. JavaScript cycles are used for continuous operation of the same code depending on the condition. In the example, the sequence sequence number is reused in ascending order. var FruitList = ["apple", "orange", "banana", "pineapple","strawberry","watermelon"] alert(FruitList[0]); alert(FruitList[1]);... Continue Reading →
JavaScript Loop Samples
Print numbers from 1 to 10 on the screen. for (i = 1; i <= 10; i++) { document.write(i+"<br>") } print 10 times in the bottom. for (i = 1; i <= 10; i++) { document.write("I love codeblogger"+"<br>") } List the ones with numbers from 1-50 on the screen. for (i = 1; i <=... Continue Reading →