Complete the code to add an element to the end of the queue.
enqueue(item: T): void {
this.items.[1](item);
}The push method adds an element to the end of an array, which is how enqueue works in a queue.
Complete the code to check if the queue is empty before enqueueing.
enqueue(item: T): void {
if (this.items.[1] === 0) {
}
this.items.push(item);
}The length property gives the number of elements in an array in TypeScript.
Fix the error in the enqueue method to correctly add the item.
enqueue(item: T): void {
this.items.[1](item);
}The correct method to add an element at the end of an array in TypeScript is push.
Fill both blanks to enqueue an item and update the size property.
enqueue(item: T): void {
this.items.[1](item);
this.size = this.items.[2];
}Use push to add the item and length to update the size of the queue.
Fill all three blanks to enqueue an item, update size, and print the queue length.
enqueue(item: T): void {
this.items.[1](item);
this.size = this.items.[2];
console.log('Queue length:', this.items.[3]);
}Use push to add the item, and length property to update size and print the queue length.
