News for hackers. Stuff that matters.
Re:The average size of Web pages is now the average size of ... by VeejayRampay on Friday April 22, 2016 @03:10PM (#11551807)
Ruby: obj.each{|k,v| ...}

Sure you can do it in JS, but calling Object.keys then forEach (in whose closure you'll still have to reference obj[key] by the way) still doesn't feel optimal.

Re:The average size of Web pages is now the average size of ... by seangrogg on Wednesday April 27, 2016 @12:18PM (#11581788)
In which case, if you really can't live without it, just attach it to the prototype.

Object.prototype.each = function(k,v){ //... }

Re:The average size of Web pages is now the average size of ... by SerpentJoe on Friday April 22, 2016 @04:12PM (#11552251)
I would argue that automatically adding methods to a user-created object isn't optimal either.