What is the index of the last element of an array with 5 elements?

  • 3
  • 4
  • 5
  • -1 (JavaScript doesn't support accessing the last element directly)
The index of the last element in an array with 5 elements is 4. JavaScript arrays are zero-indexed, so the index of the last element is one less than the total number of elements in the array. The other options are not correct for this scenario.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *