Code from Functional JavaScript Book