Skip to content

Commit 494bc23

Browse files
committed
fix: refactor Book constructor to use class syntax
1 parent 64d4740 commit 494bc23

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

debugging/book-library/script.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ function submit() {
3636
render();
3737
}
3838

39-
function Book(title, author, pages, check) {
40-
this.title = title;
41-
this.author = author;
42-
this.pages = pages;
43-
this.check = check;
39+
class Book {
40+
constructor(title, author, pages, check) {
41+
this.title = title;
42+
this.author = author;
43+
this.pages = pages;
44+
this.check = check;
45+
}
4446
}
4547

4648
function render() {

0 commit comments

Comments
 (0)