Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • I do believe that in the second line of your "fixed" ECMAScript should read (acc[thing.type] || (acc[thing.type] = [])), as opposed to ` = [thing], unless you want to add thing` to the list twice... Or am I missing something? Commented Jan 19, 2011 at 5:04
  • @Austin Hyde: You're right. Commented Jan 19, 2011 at 15:43
  • 1
    That ecmascript example is incomprehensible to many programmers. It relies on too many syntactic tricks. The loop has the advantage of obviousness for junior developers. Commented Aug 31, 2011 at 19:07