Added missing 'var' on variable declaration. (#35675)

pull/35693/head
Avahe Kellenberger 2019-03-26 23:07:58 -07:00 committed by The Coding Aviator
parent d9213b38cd
commit cde8516688
6 changed files with 36 additions and 43 deletions

View File

@ -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>

View File

@ -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++;
};

View File

@ -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++;
};

View File

@ -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++;
};

View File

@ -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++;
};

View File

@ -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++;
};