title: How to get the last item in a javascript-value object with a for loop?
body: <pre><code>var obj = { 'a' : 'apple', 'b' : 'banana', 'c' : 'carrot' }
  </code></pre>
  <p>If I do a</p>
  <pre><code>for (var key in obj) {
    console.log( key + ' has a value ' + obj[key] );
  }
  </code></pre>
  <p>It will look through all the values in <code>obj</code>. If I have a much larger object, how do I know if I am on the last iteration of that <code>for</code> loop?</p>
  <p>I realize that key value pairs aren't really organized in order, but I need to accomplish something in the very last iteration of this loop and don't know how.</p>