Exercises taken from the Eloquent Javascript book.