create a double loop in javascript

index.tsx
for (let i = 0; i < 5; i++) {
    for (let j = 0; j < 3; j++) {
        console.log(`i: ${i}, j: ${j}`);
    }
}
113 chars
6 lines

In the above code snippet, a double loop is created using nested for loops. The outer loop runs 5 times, and for each iteration of the outer loop, the inner loop runs 3 times. The console.log prints the values of i and j in each iteration of both loops.

index.tsx
0 chars
1 lines

related categories

gistlibby LogSnag