create a loopvs in javascript

index.tsx
// Using for loop
for (let i = 0; i < 5; i++) {
  console.log(i);
}

// Using while loop
let j = 0;
while (j < 5) {
  console.log(j);
  j++;
}

// Using do-while loop
let k = 0;
do {
  console.log(k);
  k++;
} while (k < 5);
225 chars
19 lines

related categories

gistlibby LogSnag