Implement a Queue class for BFS. Its methods:
enqueue(value) adds to the backdequeue() removes and returns the front value, or undefined when the queue is emptypeek() returns the front value without removing it, or undefinedisEmpty() returns a boolean- the
size getter returns the number of values currently in the queue
Every operation must take O(1) amortised time, and you may not call Array.prototype.shift. The tests replace shift with a function that throws, then push hundreds of thousands of values through your queue.