How to add a property to a JavaScript object constructor?

Posted by Ramesh Singh | 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.

Following is an example of how to add a property 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