javascript convert number with leading zero to string it change the decimal number to octal
<p>I try to convert a number with leading zero. JavaScript interpret the number with leading zero as octal number. But I would like to convert the number to string as decimal number and preserve the leading zero. Any idea?</p>

<pre><code>&lt;!DOCTYPE html&gt;
 &lt;html&gt;
 &lt;body&gt;

&lt;p&gt;Click the button to display the formatted number.&lt;/p&gt;

&lt;button onclick="myFunction()"&gt;Try it&lt;/button&gt;

&lt;p id="demo"&gt;&lt;/p&gt;

&lt;script&gt;
    function myFunction() {
    var num = 015;

    var n = Number(num).toString();
    document.getElementById("demo").innerHTML = n;
}
&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>