Computers

Image

KA JS Arrays

145
plays

6 questions

Show Answers
See Preview
  • 1. Multiple Choice
    30 seconds
    1 pt
    Which of these lines of code show how to validly store an array with 3 items?
    var nums = [42, 3, 7];
    var nums = 3, 42, 7;
    var nums = [3];
    var nums = (3, 42, 7);
  • 2. Multiple Choice
    30 seconds
    1 pt
    How would you access the second element in an array?
    nums.2
    nums[2]
    nums_1
    nums[1]
  • 3. Multiple Choice
    30 seconds
    1 pt
    How would you change the first element in an array?
    nums[1] = "New!";
    nums = "New!";
    var nums[1] = "New!";
    nums[0] = "New!";
  • Answer choices
    Tags
    Answer choices
    Tags

    Explore all questions with a free account

    Already have an account?