Quiz on Variables and Constants

Check your understanding of variables and constants.

1

What’s the output of this code?

function first() {
  for(i = 0; i < 5; i++) {
      second(); 
  }
}
function second() {
  for(i = 0; i < 3; i++) {
      console.log(i); 
  }
} 
first();
A)

0 1 2 0 1 2 0 1 2 0 1 2 0 1 2

B)

The program will not terminate.

C)

0 1 2 0 1 2

Question 1 of 50 attempted

Get hands-on with 1400+ tech skills courses.