title: How to replace/name keys in a Javascript key:value object?
body: <p>How should I replace the key strings in a Javascript key:value hash map (as an object)?</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>var hashmap = {"aaa":"foo", "bbb":"bar"};
  console.log("before:");
  console.log(hashmap);
  
  Object.keys(hashmap).forEach(function(key){
     key = key + "xxx";
     console.log("changing:");
     console.log(key);
  });
  
  console.log("after:");
  console.log(hashmap);
  </code></pre>
  
  <p>See it running in this <a href="http://jsbin.com/idobuc/1/edit" rel="noreferrer">jsbin</a>.</p>
  
  <p>The "before" and "after" hashmaps are the same, so the <code>forEach</code> seems to be in a different scope.  How can I fix it?  Perhaps there are better ways of doing this?</p>