Two Liner using inbuilt functions
\nvar maxProductDifference = function(nums) {\n    nums= nums.sort((a,b)=> a-b)\n    let l = nums.length;\n    return nums[l-1]*nums[l-2] - nums[0]*nums[1]\n};\
```\nvar maxProductDifference = function(nums) {\n    nums= nums.sort((a,b)=> a-b)\n    let l = nums.length;\n    return nums[l-1]*nums[l-2] - nums[0]*nums[1]\n};\n```
['JavaScript']