Question:medium

Which of the following JavaScript statements can be used to access the last element of an array named myArray?

Show Hint

In modern JavaScript, you can also use the newer .at() method to get the last element: myArray.at(-1) works just like myArray[myArray.length - 1].
Updated On: Jun 29, 2026
  • myArray [myArray.length+1]
  • myArray [myArray.length]
  • myArray [myArray.length - 1]
  • myArray [MyArray]
Show Solution

The Correct Option is C

Solution and Explanation

Was this answer helpful?
0