Typescript O(n) Time O(1) Space
```\n/*\n * Definition for singly-linked list.\n * class ListNode {\n *     val: number\n *     next: ListNode | null\n *     constructor(val?: number, next?: L
```\n/**\n * Definition for singly-linked list.\n * class ListNode {\n *     val: number\n *     next: ListNode | null\n *     constructor(val?: number, next?: ListNode | null) {\n *         this.val = (val===undefined ? 0 : val)\n *         this.next = (next===undefined ? null : next)\n *     }\n * }\n */\n\nfunction middleNode(head: ListNode | null): ListNode | null {\n    let [slow,fast] = [head,head];\n    while(fast && fast.next) {\n        fast = fast.next.next;\n        slow = slow.next;\n    }\n    return slow;\n};
['TypeScript', 'JavaScript']