How to add a method to a JavaScript object constructor?

Posted by Prem Tiwari | Updated on

Adding a Method to a Constructor You cannot add a new method to an object constructor the same way you add a new method to an existing object. Use the following example to add a method to a JavaScript object constructor.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers