JSFiddle - React, Tailwind, and code Playground
by Steven Senkus
JavaScript
function Person(name) {
this.state = 'sitting';
this.name = name;
}
Person.prototype.stand = function() {
this.state = 'standing';
console.log('* STANDING *');
};
Person.prototype.logProp = function(prop) {
console.log(this['name'], this[prop])
};
var Jake = new Person('Jake');
var Jillian = new Person('Jillian');
Jake.logProp('state');
Jillian.logProp('state');
Jake.stand();
Jake.logProp('state');
Jillian.logProp('state')