I need to know the differences between these person1
and person2
.
class Person {
constructor(Firstname, Lastname) {
this.Firstname = Firstname;
this.Lastname = Lastname;;
}
display() {
console.log(this.Firstname + " " + this.Lastname);
}
}
const person1 = new Person("George", "Clooney");
const person2 = {
Firstname: "George",
LastName: "Clooney"
}