News for hackers. Stuff that matters.
Re:JavaScript Prototypes Made Easy by yahelc on Saturday June 30, 2012 @05:10PM (#4182836)
If you've ever used jQuery, you've used prototypes directly. For example, with $("a").click(), "click" is a function on the jQuery object's prototype; ie, $.prototype.click . Since you're likely to have multiple jQuery objects in a script, it makes sense performance wise for all those functions to be on the prototype instead of properties of a newly created object every time you instantiate that object.

There are no comments on this comment yet.