Examples from the book Javascript Desing Patterns by Stoyan Stefanov