BananaMaster

35 - Nested for loops (JS lessons)

If you forgot something, click to go to the lesson

Task 1.

Using nested loops, draw and output to console.log:

 B_AAA B_AAA B_AAA B_AAA 

The outer loop runs 4 times. The inner loop runs 3 times.

The code must run only on button click.

Task 2.

Using nested loops, draw and output to console.log:

 123 A 123 A 123 A 123 A

The outer loop runs 4 times. The inner loop runs 3 times.

The code must run only on button click.

Task 3.

Using nested loops, draw and output to console.log:

 1 2 3 4 5 -|- 1 2 3 4 5 -|- 1 2 3 4 5 -|- 

The outer loop runs 3 times. The inner loop runs 5 times.

The code must run only on button click.

Task 4.

Using nested loops, draw and output to console.log:

-|- 1 2 3 4 5 -|- 1 2 3 4 5 -|- 1 2 3 4 5 -|- 

The outer loop runs 3 times. The inner loop runs 5 times.

The code must run only on button click.

Task 5.

Using nested loops, draw and output to console.log:

1 *** 2 *** 3 *** 4 *** 5 *** 6 ***

The outer loop runs 6 times. The inner loop runs 3 times.

The code must run only on button click.

Task 6.

Using nested loops, draw and output to console.log:

 1 (1 2 3) 2 (1 2 3) 3 (1 2 3) 

The outer loop runs 3 times. The inner loop runs 3 times.

The code must run only on button click.

Task 7.

Using nested loops, draw and output to console.log:

1111 2222 3333 4444 5555

The outer loop runs 5 times. The inner loop runs 4 times.

The code must run only on button click.