title: Capitalize first letters of string in an array
body: <p>I'm trying to write a function that will capitalize the first letter of the first and last name only... any ideas on how to approach this?  </p>
  
  <pre><code>const namesHardest = ['emIly sMith', 'angeliNA Jolie', 'braD piTt'];
  
  function capitalizeNames(peopleArray) {
      return peopleArray.toString().toLowerCase().split('').map(function(word) {
          return (word.charAt(0).toUpperCase() + word.slice(1));
      }).join(' ').split();
  }
  
  
  // set the resulting array to this variabble
  const capitalizedNames = capitalizeNames(namesHardest);
  capitalizedNames;
  </code></pre>