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.
Douglas Crockford examines the need for minimising the size of JavaScript code and compares minification and obfuscation. Obfuscation has the side-effect of introducing bugs because it changes variable names. The recommended approach is minification along with GZip compression. Since JavaScript is sent along in source form, it is impossible to hide that from a determined hacker
Although JavaScript is a class-free, object-oriented language using prototypal inheritance, it can still be used in a classical object-oriented way. Douglas Crockford compares the two inheritance-based systems, adding syntactic sugar to JavaScript to allow classical inheritance, and demonstrates a number of patterns that are not available in classical languages.