solutions to Eloquent JavaScript exercises