Add new properties to an object constructor in JavaScript
Suppose we have a function WebsiteData() and it has two parameters(title,description).
WebsiteData.prototype.keywords = "my website keywords";
Sample code and demo is here
Suppose we have a function WebsiteData() and it has two parameters(title,description).
function WebsiteData(pageTitle, pageDescription) {Add a new property 'keywords' to this function WebsiteData().
this.title = pageTitle;
this.description = pageDescription;
}
WebsiteData.prototype.keywords = "my website keywords";
Sample code and demo is here