Skip to content

Instantly share code, notes, and snippets.

@stevencombs
Created September 24, 2013 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevencombs/6692099 to your computer and use it in GitHub Desktop.
Save stevencombs/6692099 to your computer and use it in GitHub Desktop.
// 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