console.clear();
// while (condition) {
// // block of code
// }
var mValue = 0;
while (mValue < 50) {
mValue++;
}
console.log(mValue);
// for (initialization; condition; post-processing) {
// // block of code
// }
console.log('For loop with Break')
var mList = [1, 2, 3, 4, 5];
var pos;
for (pos = 0; pos < mList.length; pos++) {
if (pos >= 3) break;
console.log('Position => ' + pos + ' Value => ' + mList[pos]);
}
console.log('For loop with Continue')
for (pos = 0; pos < mList.length; pos++) {
if (pos % 2 === 0) continue;
console.log('Position => ' + pos + ' Value => ' + mList[pos]);
}