title: Extending an object with properties in Coffeescript?
body: <p>I have an array of string literals and I want to loop over them, parse them as JSON and add a property to the resulting object. I want to assign the result of this to a variable.</p>
  
  <p>And I want it to look pretty :)</p>
  
  <p>Right now I am doing this:</p>
  
  <pre><code>strings = ['{"a": "A", "b": "B"}', '{"c": "C", "d": "D"}']
  objects = for string in strings
    obj = JSON.parse string
    obj.e = 'E'
    obj
  </code></pre>
  
  <p>this gives me an array looking like this:</p>
  
  <pre><code>[{ a: 'A', b: 'B', e:'E' }, { c: 'C', d: 'D', e:'E' }]
  </code></pre>
  
  <p>Now this works but it looks a bit ugly. I guess what I'd like is something like <a href="http://documentcloud.github.com/underscore/#extend" rel="nofollow">http://documentcloud.github.com/underscore/#extend</a> (but I don't want to include underscore just for that one method)</p>
  
  <p>I found this issue: <a href="https://github.com/jashkenas/coffee-script/issues/880" rel="nofollow">https://github.com/jashkenas/coffee-script/issues/880</a>
  and this pullrequest: <a href="https://github.com/jashkenas/coffee-script/pull/2177" rel="nofollow">https://github.com/jashkenas/coffee-script/pull/2177</a>
  but the pullrequest is open and the issue is closed so I assume there's at least no operator for doing this?</p>
  
  <p>But when writing that code I can't help thinking that there's got to be a better way, so any tips would be welcome.</p>