MCPcopy Create free account
hub / github.com/coopernurse/node-pool / shift

Method shift

lib/Deque.js:18–27  ·  view source on GitHub ↗

* removes and returns the first element from the queue * @return {any} [description]

()

Source from the content-addressed store, hash-verified

16 * @return {any} [description]
17 */
18 shift() {
19 if (this.length === 0) {
20 return undefined;
21 }
22
23 const node = this._list.head;
24 this._list.remove(node);
25
26 return node.data;
27 }
28
29 /**
30 * adds one elemts to the beginning of the queue

Callers 4

_testOnBorrowMethod · 0.80
_dispatchResourceMethod · 0.80
dequeueMethod · 0.80

Calls 1

removeMethod · 0.45

Tested by

no test coverage detected