Exercise in implementing lambda calculus in JavaScript