I'm part of a small study group at work that's trying to get a better grasp on what makes JavaScript tick. In our recent discussions about objects, we've learned that an object's public methods are recreated each time an object is instantiated, while methods assigned to the object's prototype are only created once and inherited by all instances. From what I understand, both public methods and those assigned to the prototype are publicly accessible.  The question I have, then, is why bother creating public methods at all if adding to the prototype is apparently more efficient? What benefit does the public method provide that the prototype doesn't?
What's the difference between  var A = function () {     this.x = function () {         //do something     }; };   and  var A = function () { }; A.prototype.x = function () {     //do something };
The entire  site is blank right now.  The header and footer are shown, but no questions.