Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b5650a2

Browse files
consistency of while blocks
1 parent 5c513cd commit b5650a2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎data-structures/linked-list.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ LinkedList.prototype.add = function(value) {
1717
if (!current) {
1818
this.head = node
1919
} else {
20-
while (current.next) current = current.next
20+
while (current.next) {
21+
current = current.next
22+
}
2123
current.next = node
2224
}
2325
this.length++

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /