Exercise: A Tamper-Free Queue
Practice how to create a promise-based Queue class with the enqueue() and dequeue() methods.
We'll cover the following...
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 revealing constructor that provides a function called enqueue()
to the executor that pushes a new element to the end of the ...