JavaScript Merge Sort and Quick Sort Solution
Merge Short Solution\n\n\nvar sortArray = function(nums) {\n    let len = nums.length;\n    if(len < 2) return nums;\n    const mid = Math.floor(len / 2);\n    
**Merge Short Solution\n**\n```\nvar sortArray = function(nums) {\n    let len = nums.length;\n    if(len < 2) return nums;\n    const mid = Math.floor(len / 2);\n    const left = sortArray(nums.slice(0, mid));\n    const right = sortArray(nums.slice(mid, len));\n    return merge(left, right);\n    \n};\n\nfunction merge(left, right) {\n    let res = [];\n    while(left.length && right.length) {\n        res.push( (left[0] < right[0]) ? left.shift() : right.shift() );\n    }\n    return res.concat(left, right);\n}\n```\n\n**Quick Sort Solution\n**\n\n```\nvar sortArray = function(nums) {\n    let len = nums.length;\n    if(len < 2) return nums;\n    let pivot = nums[0], left=[], right = [];\n\n\n    for(let i=1; i<len; i++) {\n        if(nums[i] <= pivot) {\n            left.push(nums[i])\n        } else {\n            right.push(nums[i])\n        }\n    }\n    \n    return sortArray(left).concat(pivot, sortArray(right));\n    \n};\n```
['Merge Sort', 'JavaScript']