UNPKG

293 BPlain TextView Raw
1export default class Queue {
2 private _queue
3
4 constructor() {
5 this._queue = []
6 }
7
8 public enqueue(m) {
9 this._queue.push(m)
10 }
11
12 public unqueue() {
13 return this._queue.shift()
14 }
15
16 public hasItem() {
17 return this._queue.length > 0
18 }
19}
\No newline at end of file