title: charAt is not a function
body: <p>I'm trying to create a key mapping that keeps track of the frequency for each character of a string in my createArrayMap() function but I keep getting this error from firebug: <code>TypeError: str.charAt(...) is not a function</code></p>
  
  <p>I found the charAt() function on Mozilla's developer website it should be a function that exists.</p>
  
  <pre><code>var input;
  var container;
  var str;
  var arrMapKey = [];
  var arrMapValue = [];
  
  
  function initDocElements() {
  
      container = document.getElementById("container");
      input = document.getElementById("inputbox");
  
  }
  
  function createArrayMap() {
      str = input.value;
      for (var i = 0; i &lt; str.length; i++) {
          if (arrMapKey.find(str.charAt(i)) == undefined) {
              arrMapKey.push(str.charAt(i));
              arrMapValue.push(1);
          }
      }
  }
  
  function keyPressHandler() {
      createArrayMap();
      console.log(arrMapKey);
      console.log(arrMapValue);
  }
  
  function prepareEventHandlers() {
      input.onfocus = function() {
          if (this.value == "Start typing here!") {
              this.value = "";
          }
      };
      input.onblur = function() {
          if (this.value == "") {
              this.value = "Start typing here!";
          }
      };
      input.onkeyup = keyPressHandler;
  }
  
  window.onload = function() {
      initDocElements();
      prepareEventHandlers();
  };
  </code></pre>