Shorthand function generators for JavaScript