MDN Do While
let result = '';
let i = 0;
do {
i = i + 1;
result = result + i;
} while (i < 5);
console.log(result);
// expected result: "12345"
* MDN Loops and Iteration * |
MDN JavaScript Guide * |
For Statement |
MDN Iterators and Generators |
MDN Generator Functions*
The statements for loops provided in JavaScript are:
for statement, do...while statement, while statement, labeled statement, break statement
continue statement, for...in statement, for...of statement
const cars = ["BMW", "Volvo", "Saab", "Ford", "Fiat", "Audi"];
let text = "";
for (let i = 0; i < cars.length; i++) {
text += cars[i] + "
";
}
** w3 do while ** |
** w3 try it do while **
let text = ""
let i = 0;
do {
text += "
The number is " + i;
i++;
}
while (i < 20);
var person = {
firstName: 'John',
lastName: 'Doe',
ssn: '299-24-2351'
};
for(var prop in person) {
console.log(prop + ':' + person[prop]);
}
Scotch io JavaScript for of loop |
JS Bin Example
// array-example.js
const iterable = ['mini', 'mani', 'mo'];
for (const value of iterable) {
console.log(value);
}
// https://www.javascripttutorial.net/javascript-for-loop/
// => jfl;01
array = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
for (index = 0; index < array.length; index++) { }
console.log(array[index]);
Wednesdays Week 2
Saturday December 18 2021 0811 AM
Wednesday December 08 2021 0836 AM
Wednesday November 10 2021 0758 AM
Wednesday October 27 2021 0709 AM
Wednesday October 13 2021
Saturday September 18 2021