mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-06-28 21:05:36 -04:00
feat: initial commit
This commit is contained in:
parent
d667833847
commit
fcb8e17d6b
3 changed files with 52 additions and 0 deletions
20
library/js/script.js
Normal file
20
library/js/script.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
const myLibrary = [];
|
||||
|
||||
function Book(title, author, pages, read) {
|
||||
this.title = title;
|
||||
this.author = author;
|
||||
this.pages = pages;
|
||||
this.read = read;
|
||||
|
||||
this.info = function(){
|
||||
// returns book info
|
||||
let haveRead = this.read ? "have read" : "have not read";
|
||||
|
||||
return `${this.title}, by ${this.author}, ${this.pages} pages, ${haveRead}`;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
function addBookToLibrary(book) {
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue