Beginner Ruby
Q34 / 100

Which method removes the last element from an array and returns it?

Correct! Well done.

Incorrect.

The correct answer is B) pop

B

Correct Answer

pop

Explanation

Array#pop removes and returns the last element, while Array#shift does the same for the first element.

Progress
34/100