title: How to generate a random string of letters and numbers in Javascript?
body: <p>I have been using this code:</p>
  
  <pre><code>function stringGen()
  {
      var text = " ";
  
      var charset = "abcdefghijklmnopqrstuvwxyz0123456789";
  
      for( var i=0; i &lt; len; i++ )
          text += charset.charAt(Math.floor(Math.random() * charset.length));
  
      return text;
  }
  </code></pre>
  
  <p>But so far, it has not been working, like at all. What am I doing wrong?</p>
  
  <p>Thank you for your help in advance</p>