Fix missing "currentNode" variable declaration in data structures linked list challenges (English) (#35638)
* Fix missing variable declaration in data structures challenges (English) * Fix duplicate currentNode var declaration.
This commit is contained in:
committed by
Oliver Eyton-Williams
parent
278995d53d
commit
6a9f459a42
@ -64,7 +64,7 @@ function LinkedList() {
|
||||
if(head === null){
|
||||
head = node;
|
||||
} else {
|
||||
currentNode = head;
|
||||
var currentNode = head;
|
||||
|
||||
while(currentNode.next){
|
||||
currentNode = currentNode.next;
|
||||
|
@ -67,7 +67,7 @@ function LinkedList() {
|
||||
if(head === null){
|
||||
head = node;
|
||||
} else {
|
||||
currentNode = head;
|
||||
var currentNode = head;
|
||||
|
||||
while(currentNode.next){
|
||||
currentNode = currentNode.next;
|
||||
|
@ -46,7 +46,7 @@ tests:
|
||||
function LinkedList() {
|
||||
var length = 0;
|
||||
var head = null;
|
||||
var currentNode = null;
|
||||
|
||||
var Node = function(element){
|
||||
this.element = element;
|
||||
this.next = null;
|
||||
@ -65,7 +65,7 @@ function LinkedList() {
|
||||
if(head === null){
|
||||
head = node;
|
||||
} else {
|
||||
currentNode = head;
|
||||
var currentNode = head;
|
||||
|
||||
while(currentNode.next){
|
||||
currentNode = currentNode.next;
|
||||
|
@ -64,7 +64,7 @@ function LinkedList() {
|
||||
if(head === null){
|
||||
head = node;
|
||||
} else {
|
||||
currentNode = head;
|
||||
var currentNode = head;
|
||||
|
||||
while(currentNode.next){
|
||||
currentNode = currentNode.next;
|
||||
|
Reference in New Issue
Block a user