Skip to content

Commit 9797a43

Browse files
author
10kartik
committed
Review changes on constructor's loop
1 parent 7ccde3f commit 9797a43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Data-Structures/Linked-List/SinglyLinkedList.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class LinkedList {
2121
this.length = 0
2222

2323
if (listOfValues instanceof Array) {
24-
for (let i = 0; i < listOfValues.length; i++) {
25-
this.addLast(listOfValues[i])
24+
for (const value of listOfValues) {
25+
this.addLast(value)
2626
}
2727
}
2828
}

0 commit comments

Comments
 (0)