Arrays
3 years ago
stacydolderer
Save
Edit
Host a game
Live GameLive
Homework
Solo Practice
Practice
10 QuestionsShow answers
  • Question 1
    30 seconds
    Q. Which of the following are good examples of things to store as arrays or lists? 
    I – A to-do list 
    II – A grocery list 
    III – A ball in a game of breakout 
    IV – A list of balls in a game of breakout 
    V – A loop counter variable
    answer choices
    II only
    III and V
    I, II, and IV
    I, II, III, IV, and V
  • Question 2
    30 seconds
    Q.
    var groceries = ["milk", "sugar", "eggs", "cake"];
    What is the value of groceries[2] in the above array?
    answer choices
    "milk"
    "sugar"
    "eggs"
    "cake"
  • Question 3
    30 seconds
    Q.
    var shoppingList = ["milk", "eggs", "sugar", "bread", "cake"];
    What is the index of the item "bread" in the array shoppingList?
    answer choices
    4
    3
    5
    6
  • Question 4
    30 seconds
    Q. What is printed by the following lines of code?
    answer choices
    eggs
    bread
    2
    sugar
  • Question 5
    30 seconds
    Q. It is possible to have an array with 0 items.
    answer choices
    true
    false
  • Question 6
    30 seconds
    Q. What is the output from the following program?
    answer choices
    undefined
    25
    20
    25
    25
    undefined
    20
    20
  • Question 7
    30 seconds
    Q.
    var arr = [1, 4, 55, 23, 11, 2];
    What is the value of arr.length?
    answer choices
    5
    6
    9
    2
  • Question 8
    30 seconds
    Q.
    var firstElement = ...
    Which statement will store the first element of an array arr inside of the variable firstElement?
    answer choices
    var firstElement = arr[0];
    var firstElement = arr[1];
    var firstElement = arr[arr.length];
    var firstElement = arr[arr.length - 1];
  • Question 9
    30 seconds
    Q.
    var lastElement = ...
    Which statement will store the last element of an array arr inside of the variable lastElement?
    answer choices
    var lastElement = arr[0];
    var lastElement = arr[1];
    var lastElement = arr[arr.length];
    var lastElement = arr[arr.length - 1];
  • Question 10
    30 seconds
    Q. Describe the output of the following function:
    answer choices
    starting at the beginning of the array, prints each item in the array
    starting at the beginning of the array, prints each index of the array
    starting at the end of the array, prints each item in the array
    starting at the end of the array, prints each index of the array
Report Quiz
Join a game