javascript solution
\n/**\n * @param {number} mass\n * @param {number[]} asteroids\n * @return {boolean}\n */\nvar asteroidsDestroyed = function(mass, nums) \n{\n    nums.sort(func
```\n/**\n * @param {number} mass\n * @param {number[]} asteroids\n * @return {boolean}\n */\nvar asteroidsDestroyed = function(mass, nums) \n{\n    nums.sort(function(a, b){return a - b});\n    for(let i=0;i<nums.length;i++)\n        {\n            if(nums[i]<=mass)\n                {\n                    mass+=nums[i];\n                }\n            else\n                {\n                    return false;\n                }\n        }\n    return true;\n};\n```
['Sorting', 'JavaScript']