1// Basic Javascript Nested Loop / 2D Array
2
3for (var x = 0; x < 10; x++) {
4 for (var y = 0; y < 10; y++) {
5 console.log("x: " + x + ", y: " + y);
6 }
7}
1 var arr = [[1,2], [3,4], [5,6]];
2 for (var i=0; i < arr.length; i++) {
3 for (var j=0; j < arr[i].length; j++) {
4 console.log(arr[i][j]);
5 }
6}
1for (let exercise = 1; exercise <= 3; exercise++) {
2 console.log(`---------- Starting exercise ${exercise}`)
3
4 for (let rep = 1; rep <= 6; rep++) {
5 console.log(`Exercise ${exercise}: Lifting weight repetitition ${rep}`);
6 }
7}