Exercise 7.2

This commit is contained in:
Karan 2021-11-24 21:04:06 +05:30 committed by GitHub
parent 23372f4cbb
commit b5789a143e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

13
Chapter 7/Exercise 7.2 Normal file
View File

@ -0,0 +1,13 @@
class Person {
constructor(firstname, lastname) {
this.firstname = firstname;
this.lastname = lastname;
}
fullname(){
return this.firstname + " " + this.lastname;
}
}
let person1 = new Person("Maaike", "van Putten");
let person2 = new Person("Laurence", "Svekis");
console.log(person1.fullname());
console.log(person2.fullname());