
JavaScript Array List
Authored by Dawit Thepchatree
Computers
12th Grade
Used 6+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you access the first element of an array named 'myArray'?
myArray[0]
first(myArray)
myArray.first()
myArray(1)
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax to get the last element of an array called 'items'?
items.last()
items[length - 1]
items[items.length - 1]
items[-1]
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If 'arr' is an array, how would you access the element at index 2?
arr[2]
arr(2)
arr[1]
arr.get(2)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you modify the value of the element at index 1 in an array named 'data'?
data.push('newValue');
data[1] += 'newValue';
data[1] = 'newValue';
data[0] = 'newValue';
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will 'myArray.length' return if 'myArray' has 5 elements?
4
5.0
5
6
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you set the value of the third element in an array called 'numbers' to 10?
numbers[3] = 10;
numbers[1] = 10;
set(numbers[2], 10);
numbers[2] = 10;
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If 'colors' is an array, how do you retrieve the element at index 0?
colors(0)
get(colors, 0)
colors.index(0)
colors[0]
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Microsoft
or continue with
%20(1).png)
Apple
Others
Already have an account?