title: How to create a string with n characters? How to create a string with specific length?
body: <p>I'm writing JavaScript unit tests and I need to create a string of length 65536.
  What's the best way to do this in JavaScript?</p>
  
  <p>Currently I'm using:</p>
  
  <pre><code>var myString = '';
  for (var i = 0; i &lt;= 65535; ++i) {
      myString += 'x';
  }
  </code></pre>