title: Simple js FOR loop returning 'undefined'
body: <p>Not sure what I'm doing wrong here; the variable <code>newStr</code> should just return "Hello World", but I'm getting this instead:</p>
  
  <pre><code>"undefinedHello World"
  undefined
  </code></pre>
  
  <p>JS</p>
  
  <pre><code>function translate2(x){
    var newStr;
    x = "Hello World";
    for(i=0; i&lt;x.length; i++) {
      newStr+=x.charAt(i);
    }
    console.log(newStr);
  }
  </code></pre>