()
| 34 | } |
| 35 | |
| 36 | pop() { |
| 37 | if (this.isEmpty) { |
| 38 | return undefined; |
| 39 | } |
| 40 | |
| 41 | const item = this.start.item; |
| 42 | if (this.start === this.end) { |
| 43 | this.clear(); |
| 44 | return item; |
| 45 | } |
| 46 | |
| 47 | this.end = this.end.previous; |
| 48 | this.end.next = undefined; |
| 49 | return item; |
| 50 | } |
| 51 | |
| 52 | shift() { |
| 53 | if (this.isEmpty) { |