Accpted Javascript solution
\nconst deleteDuplicates = function(head) {\n    if(head === null || head.next === null) return head;\n    \n    const dummy = new ListNode(0);\n    dummy.next 
``` \nconst deleteDuplicates = function(head) {\n    if(head === null || head.next === null) return head;\n    \n    const dummy = new ListNode(0);\n    dummy.next = head;\n    head = dummy;\n    \n    while(head.next !== null && head.next.next !== null) {\n        if(head.next.val === head.next.next.val) {\n            let val = head.next.val;\n            while( head.next !== null && head.next.val === val ){\n                head.next = head.next.next;\n            }\n        } else {\n            head = head.next;\n        }\n\t}\n\treturn dummy.next\n}\n```
[]