2070 / JS / Цикли

 

1.

for (i=0; i<10; i++) {
}

 

2.
while (a < 10) {
}

 

3.
do {
} while (a < 10);

 

 


 
break
continue

 

 
let mas = [10, 20, 30];
for (let value of mas) {
  console.log(value)
}

 

 
let person = {fname:"Тарас", lname:"Шевченко", year:1814};
let x;
for (x in person) {
  txt += person[x] + " ";
}

 

 
let i;
let n = arr.length; // краще
for (i = 0; i < n; i++) {
}