mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-15 04:38:30 +08:00
Add the remain JavaScript code (Chapter of Array and Linkedlist)
This commit is contained in:
17
codes/javascript/include/ListNode.js
Normal file
17
codes/javascript/include/ListNode.js
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* File: ListNode.js
|
||||
* Created Time: 2022-12-12
|
||||
* Author: Justin (xiefahit@gmail.com)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Definition for a singly-linked list node
|
||||
*/
|
||||
class ListNode {
|
||||
constructor(val, next) {
|
||||
this.val = val === undefined ? 0 : val;
|
||||
this.next = next === undefined ? null : next;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ListNode;
|
Reference in New Issue
Block a user