Sugar augments the existing JavaScript environment with helper methods on existing objects. From fixing broken support of standard methods, widening acceptable arguments, multi-lingual and improved regex support on strings, nice supplementary string methods like words()
, and shortcut methods to Math object methods. Additional helpers for Dates, Objects, Functions and Regex. An library for a consistentising JavaScript across different imlementations.
Dan Webb describes curried functions as a way of creating reusable callback functions for event handlers or Ajax requests, or anything that takes a function as an argument. By using closures, curried functions have a simple way of persisting data between calls. He also offers an elegant way of running a lots of methods on objects, with a simple map function written as a curried function.
Tim describes another two different approaches to using the Module Pattern (a way of creating Singletons). The first example takes advantage of the natural indentation to clearly see which methods are private and which are public. The second is a curried function, a function that returns another function.
Douglas Crockford discusses how to create private members and methods, and using privileged methods to bridge the gap between public and private. It also contains the simplest and most understandable definition of closures I've ever seen.