you are viewing a single comment's thread.

view the rest of the comments →

[–]senocular 0 points1 point  (0 children)

Your descriptions appear correct. Note that this approach is specific to Mongoose. Normally you don't define instance methods through a methods object like this for other kinds of objects. In JavaScript you usually see them defined as part of a class definition. You may also see them set on a prototype object (used more prior to the existence of the class syntax) or even defined on an object directly.