Created
September 24, 2013 22:17
-
-
Save stevencombs/6692099 to your computer and use it in GitHub Desktop.
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
// Javascript Getting Started with Programming | |
// A Codecademy Javascript (Customizing Constructors) assignment | |
// Dr. Steven B. Combs, coding novice | |
// This format requires three lines to create a Book object | |
var harry_potter = new Object(); | |
harry_potter.pages = 350; | |
harry_potter.author = "J.K. Rowling"; | |
// This format requires a single line to create a Book object | |
var the_hobbit = new Book(320, "J.R.R. Tolkien"); | |
// A constructor(template) for the Book object | |
function Book (pages, author) { | |
this.pages = pages; | |
this.author = author; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment