Stack manipulation (Useful tip)

In Netscape 4, you can build stack managers.

With the Array methods push(), pop(), unshift() and shift(), you can build various stacks and queues.

A First In Last Out stack can be constructed with push() and pop(). This works from the end of the array.

An alternative FILO stack can be constructed with unshift() and shift() but that will operate at the start of the array.

See also:Array.pop(), Array.push(), Array.shift(), Array.unshift(), Queue manipulation

insert figure 0103

insert figure 0104

insert figure 0105

insert figure 0108