Chapter 2 exercises - Headfirst Javascript book