News for hackers. Stuff that matters.
Re:Ask HN: How should you actually do objects in Javascript? by ulisesrmzroche on Tuesday April 09, 2013 @12:21PM (#5519151)
There's a lot of special rules here, though. "Effective Javascript", in the the objects chapter is the best guide I've read to understanding JS objects. A quick tip is to implement lightweight dictionaries as literal objects to avoid prototype pollution.
Re:Ask HN: How should you actually do objects in Javascript? by TechpinesMary on Thursday April 04, 2013 @06:47PM (#5495785)
The best way is to add functions to the prototype. Also, here's a good article: http://www.phpied.com/3-ways-to-define-a-javascript-class/