Skip to content

Commit bb3f9aa

Browse files
authored
Merge pull request #1543 from lumosmind/patch-12
linked list must end with 'null'
2 parents e8947f7 + 95495bd commit bb3f9aa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

1-js/06-advanced-functions/01-recursion/article.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ let list = { value: 1 };
459459
list.next = { value: 2 };
460460
list.next.next = { value: 3 };
461461
list.next.next.next = { value: 4 };
462+
list.next.next.next.next = null;
462463
```
463464
464465
Here we can even more clearer see that there are multiple objects, each one has the `value` and `next` pointing to the neighbour. The `list` variable is the first object in the chain, so following `next` pointers from it we can reach any element.

0 commit comments

Comments
 (0)