title: How can I randomly capitalise letters in a string
body: <p>I'm sorry if this has been asked before, but I can't seem to find the right answer.</p>
  
  <p>I'm trying to create a random password generator using Javascript. I've set meself 4 basic requirements:</p>
  
  <ol>
  <li>Must contain letters, numbers and special characters</li>
  <li>Must be 14 characters</li>
  <li>Must have upper and lower case lettering</li>
  <li>Must log the result as a string</li>
  </ol>
  
  <p>Here is what I have:</p>
  
  <pre><code>var characters = 'abcdefghijklmnoqrstuvwxyz0123456789?&lt;&gt;!"£$%^&amp;*()-+./';
  var results = '';
  var length = characters.length;
  
  function randomPassword() {
  
  for (i=0; i&lt;=13; i++) {
      var mix = characters.charAt(Math.floor(Math.random() * length));        
      var newString = results += mix;
      }
      console.log(newString);
  }
  
  randomPassword();
  </code></pre>
  
  <p>The code above passes all of my requirements apart from the upper and lower case letters. Is there a way to randomly capitalise some of the letters in my string? I've tried playing with .toUpperCase() in the same way I have to create my 'mix' variable, but I can't work out how to do it.</p>
  
  <p>This isn't for any real life projects. I'm just using this as a way to try to learn Javascript, so any advice would be greatly appreciated :)</p>
  
  <p>Thanks!</p>