...

/

Exercise: A Tamper-Free Queue

Exercise: A Tamper-Free Queue

Practice how to create a promise-based Queue class with the enqueue() and dequeue() methods.

Problem statement

Create a Queue class that has only one dequeue() named publicly accessible method. Such a method returns Promise that resolves with a new element extracted from an internal queue data structure. If the queue is empty, then Promise will resolve when a new item is added. The Queue class must also have a ...