Array.prototype.shiftintermediateconst queue = []
queue.push('first')
queue.push('second')
queue.shift() // β 'first' (FIFO)Use push() and shift() together to implement a first-in, first-out (FIFO) queue.
A queue is a FIFO structure: elements are added to the back (push) and removed from the front (shift).
const queue = ['first', 'second', 'third']
const served = queue.shift() // 'first'