in reply to How can you split inside pop?
In short, a list is just a collection of things - no storage is associated with this list. An array however contains a list of things.
Consider what pop, push, shift and unshift operate on - arrays. These operators all have a side effect on your array of changing its contents. Split is a function which returns a list. If you want to be able to use push and pop, you must save to an intermediate array.
|
|---|