Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
var experience = 'novice';
var reason = 'It pays the bills.';
var Coding = function(reason){
this.reason = reason;
}
Coding.prototype.getProfitable = function(){
return this.reason + ' And now I can do it for fun.';
}
var someday = new Coding(reason);
alert(someday.getProfitable());
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.