Just simple code
\n\n# Code\n\nvar mergeInBetween = function(list1, a, b, list2) {\n    let ptr = list1;\n    for (let i = 0; i < a - 1; ++i)\n        ptr = ptr.next;\n    \n   
\n\n# Code\n```\nvar mergeInBetween = function(list1, a, b, list2) {\n    let ptr = list1;\n    for (let i = 0; i < a - 1; ++i)\n        ptr = ptr.next;\n    \n    let qtr = ptr.next;\n    for (let i = 0; i < b - a + 1; ++i)\n        qtr = qtr.next;\n    \n    ptr.next = list2;\n    while (list2.next)\n        list2 = list2.next;\n    list2.next = qtr;\n    \n    return list1;\n};\n```
['JavaScript']