Optimal Javascript Solution
\nOne Liner\n\n\n\nvar sortArray = function(nums) {\n    return nums.sort((a, b) => a - b)\n};\n\n\n\nMerge Sort: Time Complexity - O(N Log N) & Space complexit
```\nOne Liner\n```\n\n```\nvar sortArray = function(nums) {\n    return nums.sort((a, b) => a - b)\n};\n```\n\n```\nMerge Sort: Time Complexity - O(N Log N) & Space complexity - O(n)\n```\n\n```\nvar sortArray = function(nums) {\n    if(nums.length <= 1) return nums\n    \n    let midIdx = Math.floor(nums.length / 2)\n    let leftArr = sortArray(nums.slice(0, midIdx))\n    let rightArr = sortArray(nums.slice(midIdx))\n    \n    return mergeArr(leftArr, rightArr)\n};\n\nvar mergeArr = function(arr1, arr2) {\n    let results = []\n    let i = 0\n    let j = 0\n    \n    while(i <  arr1.length && j < arr2.length){\n        if(arr2[j] > arr1[i]){\n            results.push(arr1[i]);\n            i++;\n        } else {\n            results.push(arr2[j])\n            j++;\n        }\n    }\n    \n    while(i < arr1.length) {\n        results.push(arr1[i])\n        i++;\n    }\n    \n    while(j < arr2.length) {\n        results.push(arr2[j])\n        j++;\n    }\n    \n     return results;\n}\n```
['JavaScript']