Stacks and queues are types of lists, although they managed adding and removing elements differently. Normal arrays allow you to add and remove elements at any index within the array. Stacks use First In, First Out (FIFO) and queues use a Last In, First Out (LIFO) method of processing data and elements.
Queues act like queues at shopping markets, the first person in the queue is the first person to be served. Whereas, stacks act like stacks of pancakes, the first pancake put on the plate is the last pancake to be eaten. The last pancake, the one at the top of the stack, will be the first pancake to be eaten.
push() adds an element to the end of an array.
pop() removes and element from the end of the array.
shift() adds an element to the start of an array.
unshift() removes and element from the start of the array.