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.
Klaus Komenda discusses a number of ways of encapsulating JavaScript functions into objects and namespaces, and shows how to use each pattern. He covers Singletons, Douglas Crockford's Module Pattern and Custom Objects, building the same functionality with each technique.
Dean Edwards takes Mozilla's newly introduced forEach method, and implements it for non-Mozilla browsers, for enumerating over objects and arrays.