Concise JavaScript solution
function insertionSortList(head) {\n        var before = { val: -Number.MAX_VALUE, next: null };\n        \n        while (head) {\n            var prev = befor
    function insertionSortList(head) {\n        var before = { val: -Number.MAX_VALUE, next: null };\n        \n        while (head) {\n            var prev = before;\n            \n            // find prev\n            while (prev.next && prev.next.val < head.val) {\n                prev = prev.next;\n            }\n            \n            var next = head.next;\n            head.next = prev.next;\n            prev.next = head;\n            head = next;\n        }\n        \n        return before.next;\n    }
[]