We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a4526c0 commit 8646a22Copy full SHA for 8646a22
chapter04/03-PriorityQueue.js
@@ -3,14 +3,14 @@ function PriorityQueue() {
3
var items = [];
4
5
function QueueElement (element, priority){
6
- element = element;
7
- priority = priority;
+ this.element = element;
+ this.priority = priority;
8
}
9
10
this.enqueue = function(element, priority){
11
var queueElement = new QueueElement(element, priority);
12
13
- if (isEmpty()){
+ if (this.isEmpty()){
14
items.push(queueElement);
15
} else {
16
var added = false;
0 commit comments