Javascript How to get first three characters of a string
<p>This may duplicate with previous topics but I can't find what I really need.</p>

<p>I want to get a first three characters of a string. For example:</p>

<pre><code>var str = '012123';
console.info(str.substring(0,3));  //012
</code></pre>

<p>I want the output of this string '012' but I don't want to use subString or something similar to it because I need to use the original string for appending more characters '45'. With substring it will output 01245 but what I need is 01212345.</p>