* removes and returns the first element from the queue * @return {any} [description]
()
| 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 |
no test coverage detected