js closures, props and currying