// Using for loopfor (let i = 0; i < 5; i++) {
console.log(i);
}
// Using while looplet j = 0;
while (j < 5) {
console.log(j);
j++;
}
// Using do-while looplet k = 0;
do {
console.log(k);
k++;
} while (k < 5);
// Using forEach loop for arrayslet arr = [1, 2, 3, 4, 5];
arr.forEach(item => {
console.log(item);
});
// Using for...of loop for arraysfor (const item of arr) {
console.log(item);
}