Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/School-Work / School Work/What are Constructor Functions/books.js |
| Date | Not specified in source |
| Repository | Janady13/School-Work |
| Revision | 4a666c890caf7c43c47d0572dbcc287373c7a78e |
| Branch | main |
| Path or archive member | School Work/What are Constructor Functions/books.js |
| Original SHA-256 | 54f0f839e86ff85a7123817ab6386c624b78d768aaa005b685d37d0cbb0867f1 |
| Git blob SHA | af7a11093192fc417c3173b646d05bcadf30185c |
| Reading-copy SHA-256 | 54f0f839e86ff85a7123817ab6386c624b78d768aaa005b685d37d0cbb0867f1 |
Recovered source transcript
Download complete source text ↓21 lines · 0.5 KB
function Book(title, author, themes=[]) {
this.title = title;
this.author = author;
this.themes = themes;
}
Book.prototype.addthemes = function(theme){
this.themes =[...this.themes, theme]
}
const book1 = new Book ('Eye of the World', "Robert Jordan", "Fantasy");
const book2 = new Book ("StormLight Archieve","Brandon Sanderson","Action");
console.log(book1);
console.log(book2);
book1.addthemes("action")
book2.addthemes("Fantasy")
console.log(book1)
console.log(book2)