Edit This Code:
See Result »
The pop method returnes the removed item.
Try it
Result: