Complete the code to remove the last element from the array.
const arr = [1, 2, 3, 4]; arr.[1](); console.log(arr);
The pop() method removes the last element from an array.
Complete the code to remove the last element and store it in a variable.
const numbers = [10, 20, 30, 40]; const last = numbers.[1](); console.log(last);
pop() removes the last element and returns it, so it can be stored.
Fix the error in the code to correctly remove the last element from the array.
let fruits = ['apple', 'banana', 'cherry']; fruits.[1]; console.log(fruits);
The method pop() must be called with parentheses to execute and remove the last element.
Fill both blanks to remove the last element and print the updated array.
const colors = ['red', 'green', 'blue']; colors.[1](); console.log([2]);
Use pop() to remove the last element, then print the updated array colors.
Fill both blanks to remove the last element, store it, and print both the removed element and updated array.
const pets = ['dog', 'cat', 'rabbit']; const removed = pets.[1](); console.log(removed); console.log([2]);
pop() removes and returns the last element, which is stored in removed. Then print removed and the updated array pets.
