Excercise from Eloquent Javascript Book