title: Sort an Array by Identifying the numeric value for each element through charCodeAt() method in Javascript?
body: <p>Here is the code that I've thus far to sort an array by the charCodeAt() method. Can someone help me identify what is incorrect?</p>
  
  <pre><code>var sortByCharCodeAt = function(array){
    array.sort((a, b) =&gt; a.charCodeAt - b.charCodeAt)
    for (i = 0; i &lt; array.length; i++){
      array.sort((a, b) =&gt; {
        a.charCodeAt(i) - b.charCodeAt(i)
      })
    }
    console.log(array);
  }
  
  sortByCharCodeAt(["h", "e", "l", "l", "o"]);
  </code></pre>