Javascript Functions and Closures for Private Properties

A JavaScript Module Pattern is a fantastic example of how to use closures.

Javascript Closures has more detailed information.

Douglas Crockford brought the style over to JS, and his site has a lot of important articles about Javascript hacking (as a functional language).

A good description of closures is part of Blocks and Closures in Ruby an interview with Matz.

This video, Advanced Topics In Programming Languages: Closures For Java with Neal Gafter has a pretty detailed explanation about implementing closures in Java.

Last but not least, PHP 5.3 will have closures. What's new in PHP by John Mertic at IBM developerworks details the feature. The PHP RFC also has good examples.

AttachmentSize
closure.png12.65 KB