JSFiddle - React, Tailwind, and code Playground
by jeffsturgis
JavaScript
var Person = function(name) {
this.name = name;
};
Person.prototype = {
sayName: function() {
return ('my name is ' + this.name);
}
};
var jeff = new Person('jeff');
jeff.sayName = function() {
console.log(Person.prototype.sayName.call(this) + ' i like pizza');
};
jeff.sayName();