April 2018
Beginner to intermediate
426 pages
10h 19m
English
To clear all the elements from the queue, we can evoke the dequeue method until it returns undefined or we can simply reset the value of the Queue class properties to the same values as declared in its constructor:
clear() { this.items = {}; this.count = 0; this.lowestCount = 0;}