Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Javascript loops

for(let i = 1; i <= 5; i++){
    if (i % 2 !== 0) console.log("Number", i);
}

let i = 2;
while (i <= 6){
    console.log("Number", i);
    i++
}

let j = 1;
do {
    console.log("Number", j);
    j++;
} while(j <= 5)
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #Javascript #loops
ADD COMMENT
Topic
Name
9+8 =