title: (replace) CamelCase function not work properly
body: <p>working with this function call:</p>
  
  <pre><code>var StringData = window.ToCamelCase({ 'string': 'HELLO WORLD', 'remSpace': false });
  console.log(StringData);
  </code></pre>
  
  <p>and this is my script function:</p>
  
  <pre><code>function ToCamelCase(data) {
      data['string'] = data['string'].replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
          return index == 0 ? word.toUpperCase() : word.toLowerCase();
      });
      if (data['remSpace']) {
          data['string'] = data['string'].replace(/\s/g, '');
      }
      return data['string'];
  }
  </code></pre>
  
  <p>i dont get error; but not work properly, if i passed and string like this:</p>
  
  <pre><code>"HELLO WORLD"
  </code></pre>
  
  <p>this moment second word not put first letter uppercase</p>
  
  <p>the output is: <code>"Hello world"</code> and i expect: <code>"Hello World"</code></p>
  
  <p><strong><em>First letter per word Upper Case and the following Lower Case is the rule.</em></strong></p>
  
  <p><strong>what am I doing wrong?</strong></p>