Head First JavaScript Code: Chapter 10, Creating Custom Objects

Chapter 10 Opening Image

If it was only that easy, we'd surely have it made.

Head First JavaScript

JavaScript doesn't have a money back guarantee but you can definitely have it your way. Custom objects are the JavaScript equivalent of a decaf triple shot grande extra hot no whip extra drizzle no foam marble mocha macchiato. That is one custom cup of coffee! And with custom JavaScript objects, you can brew up some code that does exactly what you want, while taking advantage of the benefits of properties and methods. The end result is reusable code that effectively extends the JavaScript language...just for you!

Download the Code

Code Description and Viewing

YouCube

The YouCube web page from Chapter 9 is continued here, and is built incrementally throughout the chapter. Each numbered HTML file corresponds to an incremental version of the web page. When a page number appears beside a file, it is either the page where the file's contents are presented or the exercise (solution) corresponding to the file.

  • youcube8.html - YouCube web page with Blog object methods converted to class-owned methods (page 458)
  • youcube9.html - YouCube web page with the signature property added to the Blog object (page 465)
  • youcube10.html - YouCube web page with the custom shortFormat() method added to the standard Date object (page 470)
  • youcube11.htmll - YouCube web page with the comparison function converted to a class method (page 474)
  • youcube12.html - YouCube web page with support for blog entries that have images (page 480)
  • cube.png - Cube image that appears on the YouCube web page
  • cube777.png - Seven-sided cube image used in a YouCube blog entry