mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-24 02:03:10 +08:00
fix the error about assignment to constant
This commit is contained in:
@ -22,7 +22,7 @@ class ListNode {
|
|||||||
*/
|
*/
|
||||||
arrToLinkedList(arr) {
|
arrToLinkedList(arr) {
|
||||||
const dum = new ListNode(0);
|
const dum = new ListNode(0);
|
||||||
const head = dum;
|
let head = dum;
|
||||||
for (const val of arr) {
|
for (const val of arr) {
|
||||||
head.next = new ListNode(val);
|
head.next = new ListNode(val);
|
||||||
head = head.next;
|
head = head.next;
|
||||||
|
Reference in New Issue
Block a user