In this javascript example I wrote a javascript for a loop to print out numbers from 1 to 100 that are evenly divisible by 5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<script> for(let i=1;i<=100;i++) { // if iteration number divisible to 3, block works. if(i%3==0) { document.write(`${i} is divisble to 3<br>`); } } </script> <!-- Write a javascript for a loop to print out numbers from 1 to 100 that are evenly divisible by 3 --> |