I understand that prototype method is shared by all instances of an object in JavaScript.
I can’t think of a practical example when you will need the other situation—declaring the method inside the constructor function and thus making every instance of the object having it’s own instance of the method. Can you provide a case for this?
The primary use is emulating private fields. See my answer here for an example:
Declaring javascript object method in constructor function vs. in prototype