-
-
Save codecademydev/95b30c2f3e9ce25e424ea172b5d7a975 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 3 lines required to make harry_potter | |
var harry_potter = new Object(); | |
harry_potter.pages = 350; | |
harry_potter.author = "J.K. Rowling"; | |
// A custom constructor for book | |
function Book (pages, author) { | |
this.pages = pages; | |
this.author = author; | |
} | |
// Use our new constructor to make the_hobbit in one line | |
var the_hobbit = new Book(320, "J.R.R. Tolkien" ); | |
console.log(the_hobbit); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment