To create a new object property, we need to use the keyword this
followed by a period and the property name.
class Book {
constructor(author, title) {
this.author
}
}
To finish creating the new object property, we'll assign the author
parameter as a value to this.author
.
class Book {
constructor(author, title) {
this.author = author;
this.title = title;
}
}