JSFiddle - React, Tailwind, and code Playground
by kkdaily
JavaScript
const Shoebear = function (name, age, color, sex) {
this.name = name || 'Shoebear';
this.age = age;
this.color = color;
this.sex = sex;
}
Shoebear.prototype.poop = function () {
console.log('prrrfffffft');
}
Shoebear.prototype.sleep = function () {
console.log('zzzz');
}
Shoebear.prototype.introduction = function () {
alert(`Hi, my name is ${this.name}`);
}
const shoebear = new Shoebear(null, 27, 'brown', 'male');
shoebear.introduction();