Adding zeros when length is less
<p>Is there a smart way to convert numbers to string and automatically add zeroes so the length is the same as the maximum?</p>

<p>like this:</p>

<pre><code>for (var i=0; i&lt;30; i++) {
    var c = i.toString();
    if (c.length == 1) {
        c = '0'+=c;
    }
}
</code></pre>

<p>But smarter</p>
