function Person(firstName, lastName) {
this.firstName = firstName
this.lastName = lastName
}
const person = new Person("John", "Smith")
Person.getFullName = function () {
return `${this.firstName} ${this.lastName}`
}
console.log(person.getFullName())
Post #2290
903
- 👍 4