JSFiddle - React, Tailwind, and code Playground
JavaScript
function Person(name = 'abcd') {
this.name = name
}
Person.prototype.sayHello = function () {
console.log(`hello! ${this.name}`)
console.log(this)
}
const a = new Person('PARK')
function Person(name = 'abcd') {
this.name = name
}
Person.prototype.sayHello = function () {
console.log(`hello! ${this.name}`)
console.log(this)
}
const a = new Person('PARK')