Chapter 2 finished. javascrip version.