Exams
Subjects
Classes
Home
Exams
Web Applications
JavaScript
which of the following ja...
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].
CBSE Class XII - 2026
CBSE Class XII
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
Download Solution in PDF
Was this answer helpful?
0
Top Questions on JavaScript
Which JavaScript statement is used to delete the property age from the object person?
CBSE Class XII - 2026
Web Applications
JavaScript
View Solution
Which of the following is an invalid function name in JavaScript?
CBSE Class XII - 2026
Web Applications
JavaScript
View Solution
What will be the output of the following JavaScript code ?
CBSE Class XII - 2026
Web Applications
JavaScript
View Solution
Which array method in JavaScript is used to insert an element at the beginning of an array ?
CBSE Class XII - 2026
Web Applications
JavaScript
View Solution
Want to practice more? Try solving extra ecology questions today
View All Questions
Questions Asked in CBSE Class XII exam
The role of a catalyst is to change _____________ .
CBSE Class XII - 2025
Surface Chemistry
View Solution
Which of the following statements is true for the function
\[ f(x) = \begin{cases} x^2 + 3, & x \neq 0, \\ 1, & x = 0? \end{cases} \]
CBSE Class XII - 2024
Functions
View Solution
\( \int_a^b f(x) \, dx \) is equal to:
CBSE Class XII - 2024
Functions
View Solution
Let \( \theta \) be the angle between two unit vectors \( \mathbf{\hat{a}} \) and \( \mathbf{\hat{b}} \) such that \( \sin \theta = \frac{3}{5} \). Then, \( \mathbf{\hat{a}} \cdot \mathbf{\hat{b}} \) is equal to:
CBSE Class XII - 2024
Vector Algebra
View Solution
If the direction cosines of a line are \( \sqrt{3}k, \sqrt{3}k, \sqrt{3}k \), then the value of \( k \) is:
CBSE Class XII - 2024
Trigonometry
View Solution