What will be the return value of ["apple", "banana", "cherry"].pop();?
- "apple"
- "banana"
- "cherry"
- undefined
The return value will be "cherry". The pop() method removes the last element from an array and returns that element. In this case, it removes "cherry" from the end of the array and returns it.
Loading...
Related Quiz
- The ______ statement is used to specify a block of code to be executed if the condition is false.
- The comparison operator _______ checks for inequality, considering type coercion.
- What is "Promise chaining" in JavaScript?
-
How can you select all
elements within a specific parent element?
- When using a for...of loop with strings, each iteration will provide a single _______.