We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ec422e commit 4d6735eCopy full SHA for 4d6735e
1 file changed
Data Structures/Queue/Queue.js
@@ -9,13 +9,15 @@
9
10
var Queue = (function () {
11
12
+ // constructor
13
function Queue() {
14
15
//This is the array representation of the queue
16
this.queue = [];
17
18
}
19
20
+ // methods
21
//Add a value to the end of the queue
22
Queue.prototype.enqueue = function (item) {
23
this.queue[this.queue.length] = item;
@@ -79,4 +81,4 @@ for (var i = 0; i < 5; i++) {
79
81
myQueue.view();
80
82
83
-//console.log(myQueue.dequeue());
84
+//console.log(myQueue.dequeue()); // throws exception!
0 commit comments