JavaScript MCQ Basic JavaScript MCQ Question #4853
Single Choice Not Set

QWhat is the correct way to access the third element in an array arr?

ID: #4853 Basic JavaScript MCQ 246 views
Question Info
#4853Q ID
Not SetDifficulty
Basic JavaScript MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A arr[3]
  • B arr.3
  • C arr(3)
  • D arr.get(3)
Correct Answer

Explanation

arr[3] is the correct way to access the third element in an array arr.
In JavaScript, you can use square brackets ([]) to access elements in an array by their index.
The index of the first element in an array is 0,
so to access the third element, you would use an index of 2.

Share This Question

Challenge a friend or share with your study group.