Easy JavaScript Solution
\n\nvar smallestNumber = function(num) {\n    let arr = Array.from(String(num));\n    if(num>0){\n    arr.sort((a,b)=>{\n         return a-b;\n    })\n    }\n  
```\n\nvar smallestNumber = function(num) {\n    let arr = Array.from(String(num));\n    if(num>0){\n    arr.sort((a,b)=>{\n         return a-b;\n    })\n    }\n    else{\n         arr.sort((a,b)=>{\n              return b-a;\n         })\n    }\n    for(let i=0;i<arr.length;i++){\n       if(arr[i]!=0){\n            [arr[0],arr[i]]=[arr[i],arr[0]];\n            break;\n       }\n  }\n    return arr.join("");\n};\n```
['JavaScript']