Solutions to chapter exercises in Eloquent JavaScript (2nd ed)