Hi @Carol_Enderlin !!
In this question
Q: The following statement:
student[0];
will access the first element in the array.
A)
True
B)
False
The correct answer is:
A) True
Explanation:
In the given explanation, the array is defined as:
var students = ["Mary", 10, "Barbara", 11, "David", 12, "Alex", 11];
Arrays in JavaScript are zero-indexed, which means that the first element of the array has an index of 0, the second element has an index of 1, and so on.
So, when you use students[0]
, you are accessing the first element of the array, which is “Mary”. This is why the statement student[0];
is true; it will indeed access the first element in the array.
The quiz statement is asking whether the statement student[0];
will access the first element in the array, and the correct answer is “True.”
I hope it helps. Happy Learning