Added missing 'var' on variable declaration. (#35675)
parent
d9213b38cd
commit
cde8516688
|
@ -53,18 +53,17 @@ function LinkedList() {
|
|||
|
||||
this.add = function(element){
|
||||
var node = new Node(element);
|
||||
if(head === null){
|
||||
if (head === null){
|
||||
head = node;
|
||||
} else {
|
||||
var currentNode = head;
|
||||
|
||||
while(currentNode.next){
|
||||
while (currentNode.next) {
|
||||
currentNode = currentNode.next;
|
||||
}
|
||||
|
||||
currentNode.next = node;
|
||||
}
|
||||
|
||||
length++;
|
||||
};
|
||||
|
||||
|
@ -73,7 +72,6 @@ function LinkedList() {
|
|||
// Only change code above this line
|
||||
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
</div>
|
||||
|
|
|
@ -54,18 +54,17 @@ function LinkedList() {
|
|||
|
||||
this.add = function(element){
|
||||
var node = new Node(element);
|
||||
if(head === null){
|
||||
if (head === null){
|
||||
head = node;
|
||||
} else {
|
||||
var currentNode = head;
|
||||
|
||||
while(currentNode.next){
|
||||
while (currentNode.next) {
|
||||
currentNode = currentNode.next;
|
||||
}
|
||||
|
||||
currentNode.next = node;
|
||||
}
|
||||
|
||||
length++;
|
||||
};
|
||||
|
||||
|
|
|
@ -61,18 +61,17 @@ function LinkedList() {
|
|||
|
||||
this.add = function(element){
|
||||
var node = new Node(element);
|
||||
if(head === null){
|
||||
if (head === null){
|
||||
head = node;
|
||||
} else {
|
||||
var currentNode = head;
|
||||
|
||||
while(currentNode.next){
|
||||
while (currentNode.next) {
|
||||
currentNode = currentNode.next;
|
||||
}
|
||||
|
||||
currentNode.next = node;
|
||||
}
|
||||
|
||||
length++;
|
||||
};
|
||||
|
||||
|
|
|
@ -54,18 +54,17 @@ function LinkedList() {
|
|||
|
||||
this.add = function(element){
|
||||
var node = new Node(element);
|
||||
if(head === null){
|
||||
if (head === null){
|
||||
head = node;
|
||||
} else {
|
||||
var currentNode = head;
|
||||
|
||||
while(currentNode.next){
|
||||
while (currentNode.next) {
|
||||
currentNode = currentNode.next;
|
||||
}
|
||||
|
||||
currentNode.next = node;
|
||||
}
|
||||
|
||||
length++;
|
||||
};
|
||||
|
||||
|
|
|
@ -54,18 +54,17 @@ function LinkedList() {
|
|||
|
||||
this.add = function(element){
|
||||
var node = new Node(element);
|
||||
if(head === null){
|
||||
if (head === null){
|
||||
head = node;
|
||||
} else {
|
||||
var currentNode = head;
|
||||
|
||||
while(currentNode.next){
|
||||
while (currentNode.next) {
|
||||
currentNode = currentNode.next;
|
||||
}
|
||||
|
||||
currentNode.next = node;
|
||||
}
|
||||
|
||||
length++;
|
||||
};
|
||||
|
||||
|
|
|
@ -54,18 +54,17 @@ function LinkedList() {
|
|||
|
||||
this.add = function(element){
|
||||
var node = new Node(element);
|
||||
if(head === null){
|
||||
if (head === null){
|
||||
head = node;
|
||||
} else {
|
||||
var currentNode = head;
|
||||
|
||||
while(currentNode.next){
|
||||
while (currentNode.next) {
|
||||
currentNode = currentNode.next;
|
||||
}
|
||||
|
||||
currentNode.next = node;
|
||||
}
|
||||
|
||||
length++;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue