MCPcopy Create free account
hub / github.com/datastructures-js/priority-queue / [Symbol.iterator]

Method [Symbol.iterator]

src/priorityQueue.js:172–183  ·  view source on GitHub ↗

* Implements an iterable on the priority queue * @public

()

Source from the content-addressed store, hash-verified

170 * @public
171 */
172 [Symbol.iterator]() {
173 let size = this.size();
174 return {
175 next: () => {
176 size -= 1;
177 return {
178 value: this.pop(),
179 done: size === -1
180 };
181 }
182 };
183 }
184}
185
186/**

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.95
popMethod · 0.95

Tested by

no test coverage detected