JSFiddle - React, Tailwind, and code Playground
by Abdul Ahmad
JavaScript
const obInterface = {
name: '',
setName: function(newName) {
this.name = newName;
},
getName: function() { return this.name },
sayName: function() { console.log('name: ', this.name); },
};
const arbiter = {
...obInterface,
name: 'arbiter',
};
const chief = {
...obInterface,
name: 'chief',
};
chief.sayName();