Find the boundary bugs in this generated linked queue.
JavaScript
class Queue {
constructor() {
this.head = null;
this.tail = null;
this.size = 0;
}
enqueue(value) {
const node = { value, next: null };
if (this.tail) this.tail.next = node;
else this.head = node;
this.tail = node;
this.size += 1;
}
dequeue() {
const value = this.head.value;
this.head = this.head.next;
this.size -= 1;
return value;
}
}