Match the index with the value.
var myNumbers = [32, 64, 33, 0, 15, 26, 3]
myNumbers[4]
Lists
Quiz
•
Computers
•
10th - 12th Grade
•
Medium
Robin West
Used 2+ times
FREE Resource
18 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Match the index with the value.
var myNumbers = [32, 64, 33, 0, 15, 26, 3]
myNumbers[4]
64
15
0
33
Answer explanation
The value at index 4 in the array myNumbers is 15, so the correct match is 15.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
//Consider this code:
var list = [10, 12, 14, 16, 18];
appendItem(list, 3);
insertItem(list, 2, 20);
removeItem(list, 0);
//What is printed to the console?
console.log(list);
10, 12, 14, 16, 18
3, 12, 14, 20, 16, 18
10, 12, 14 , 20, 16, 18, 3
12, 20, 14, 16, 18, 3
Answer explanation
The code appends 3 to the end of the list, inserts 20 at index 2, and then removes the item at index 0. So, the correct answer is 12, 20, 14, 16, 18, 3.
3.
FILL IN THE BLANK QUESTION
3 mins • 1 pt
//Consider this code:
var list = [10, 12, 14, 16, 18];
appendItem(list, 3);
insertItem(list, 2, 20);
removeItem(list, 0);
//What is printed to the console?
console.log(list[0]);
4.
FILL IN THE BLANK QUESTION
3 mins • 1 pt
//Consider this code:
var list = [10, 12, 14, 16, 18];
appendItem(list, 3);
insertItem(list, 2, 20);
removeItem(list, 0);
//What is printed to the console?
console.log(list.length);
5.
FILL IN THE BLANK QUESTION
3 mins • 1 pt
//Consider this code:
var list = [10, 12, 14, 16, 18];
appendItem(list, 3);
insertItem(list, 2, 20);
removeItem(list, 0);
//What is printed to the console?
console.log(list[list.length-1]);
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
//Consider this code.
var listOne = [2, 1, 0];
var listTwo = [1, 2, 0];
var a = listTwo[listOne[0]];
var b = 3 - a;
//What is printed to the console?
console.log(b);
0
2
-1
1
3
Answer explanation
The value of a is 0, so b = 3 - 0 = 3. Therefore, the printed value to the console is 3.
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
//Consider this code.
var listOne = [2, 1, 0];
var listTwo = [1, 2, 0];
//What is printed to the console?
console.log( listOne[1] + listTwo[1] );
0
2
4
1
3
Answer explanation
The code prints the sum of the values at index 1 of listOne and listTwo, which is 3.
15 questions
IF and Vlookup Function
Quiz
•
9th - 10th Grade
20 questions
Programming
Quiz
•
9th - 11th Grade
20 questions
8525 AQA GCSE 3.2.6 Data Structures
Quiz
•
10th Grade
15 questions
Javascript
Quiz
•
10th - 12th Grade
20 questions
Unit 5 Quiz - Loops & Lists (code.org)
Quiz
•
10th - 12th Grade
20 questions
AP CSP Unit 6
Quiz
•
10th - 12th Grade
15 questions
Basic Data Structures - Intro to CS
Quiz
•
12th Grade
20 questions
Loops, Lists, Traversals test
Quiz
•
11th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression
Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University