19.06.2022, 12:51 - Wörter:
(Dieser Beitrag wurde zuletzt bearbeitet: 19.06.2022, 22:15 von admin.)
Code:
function Person(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
this.getFullName = () => `${this.first_name} ${this.last_name}`;
}
const person1 = new Person('John', 'Doe');
console.log(person1.getFullName);