Skip to content

Instantly share code, notes, and snippets.

@donedgardo
Last active February 7, 2017 22:20
Show Gist options
  • Save donedgardo/b0703de1fd93d056d92dc9bc280d0d97 to your computer and use it in GitHub Desktop.
Save donedgardo/b0703de1fd93d056d92dc9bc280d0d97 to your computer and use it in GitHub Desktop.
Intro JS Quiz #2

Intro to JS Quiz #2

Loops and functions

1.Given the following array, what is the value of test:

var school = [
  ['David', 'Yamil', 'Edgardo'],
  ['Mari', 'Jan', 'Luis', 'Nelson']
];
var test = school[1][2];

2.Given the following loop, what is the value of test:

var x = 0;
do {
 x++;
} while (x < 0);
var test = x;

3.Given the following loop. what is the value of test after loops are done:

var test = 1;
for(var x=0; x < 4; x++){
  for(var y=0; y < 5; y++){
    test++;
  }
}
@JanVelazquez
Copy link

  1. Luis
  2. 4
  3. 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment