TY - BOOK AU - Stefanov,Stoyan TI - JavaScript patterns SN - 9780596806750 (pbk.) AV - QA76.73 .J39 S74 2010 PY - 2010/// CY - Sebastopol, CA PB - O'Reilly KW - JavaScript (Computer program language) KW - Software patterns KW - Web site development N1 - Includes index; Preface -- 1. Introduction -- Patterns -- JavaScript: concepts -- ECMAScript 5 -- JSLint -- The Console -- 2. Essentials -- Writing maintainable code -- Minimizing globals -- For loops -- For-in loops -- (Not) augmenting built-in prototypes -- Switch pattern -- Avoiding implied typecasting -- Number conversions with parseInt() -- Coding conventions -- Naming conventions -- Writing comments -- Writing API docs -- Writing to be read -- Peer reviews -- Minify...in production -- Run JSLint -- Summary -- 3. Literals and constructors -- Object literal -- Custom constructor functions -- Patterns for enforcing new -- Array literal -- JSON -- Regular expression literal -- Primitive wrappers -- Error objects -- Summary -- 4. Functions -- Background -- Callback pattern -- Returning functions -- Self-defining functions -- Immediate functions -- Immediate object initialization -- Init-time branching -- Function properties -- a memorization pattern -- Configuration objects -- Curry -- Summary 5. Object creation patterns -- Namespace pattern -- Declaring dependencies -- Private properties and methods -- Module pattern -- Sandbox pattern -- Static members -- Object constants -- Chaining pattern -- Method() method -- Summary -- 6. Code reuse patterns -- Classical versus modern inheritance patterns -- Expected outcome when using classical inheritance -- Classical pattern #1 -- the default pattern -- Classical pattern #2 -- rent-a-constructor -- Classical pattern #3 -- rent and set prototype -- Classical pattern #4 -- share the prototype -- Classical pattern #5 -- a temporary constructor -- Klass -- Prototypal inheritance -- Inheritance by copying properties -- Mix-ins -- Borrowing methods -- Summary -- 7. Design patterns -- Singleton -- Factory -- Iterator -- Decorator -- Strategy -- Facade -- Proxy -- Mediator -- Observer -- Summary -- 8. DOM and browser patterns -- Separation of concerns -- DOM scripting -- Events -- Long-running scripts -- Remote scripting -- Deploying JavaScript -- Loading strategies -- Summary -- Index ER -