One of the joys of JavaScript is the support for anonymous functions.
Software will save us describes Stuart Langridge’s technique where he creates an associative array of anonymous functions to provide a package.
var Foo =
{
a: function () { ... },
b: function () { ... }
};
Foo.a ();
Foo.b ();
You could do the same thing by defining a prototype object with the same methods, so I’m not clear on the advantage of doing this. But it does demonstrate more of JavaScript’s under-appreciated cool.