I need an Array method similar to Array.pop (), which demonstrates First In First Out behavior, not the native FILO behavior. Is there an easy way to do this?
Imagine a javascript console:
>> array = []; >> array.push(1); >> array.push(2); >> array.push(3); >> array.fifopop(); 1 <-- array.pop() yields 3, instead
source share