mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-25 13:06:30 +08:00
fix the error about assignment to constant
This commit is contained in:
parent
bb20cb9db2
commit
c3395be905
1 changed files with 1 additions and 1 deletions
|
@ -22,7 +22,7 @@ class ListNode {
|
|||
*/
|
||||
arrToLinkedList(arr) {
|
||||
const dum = new ListNode(0);
|
||||
const head = dum;
|
||||
let head = dum;
|
||||
for (const val of arr) {
|
||||
head.next = new ListNode(val);
|
||||
head = head.next;
|
||||
|
|
Loading…
Reference in a new issue