JavaScript: The Good Parts Publisher: O'Reilly

1 JavaScript: The Good Parts by Douglas Crockford

Publisher: O'Reilly Pub Date: May 2, 2008 Print ISBN-13: 978-0-596-51774-8 Pages: 170 Table of Contents | Index Overview

Most programming languages contain good and bad parts, but JavaScript has more than its share of the bad, having been developed and released in a hurry before it could be refined. This authoritative book scrapes away these bad features to reveal a subset of JavaScript that's more reliable, readable, and maintainable than the language as a whole-a subset you can use to create truly extensible and efficient code. Considered the JavaScript expert by many people in the development community, author Douglas Crockford identifies the abundance of good ideas that make JavaScript an outstanding object-oriented programming language-ideas such as functions, loose typing, dynamic objects, and an expressive object literal notation. Unfortunately, these good ideas are mixed in with bad and downright awful ideas, like a programming model based on global variables. When Java applets failed, JavaScript became the language of the Web by default, making its popularity almost completely independent of its qualities as a programming language. In JavaScript: The Good Parts, Crockford finally digs through the steaming pile of good intentions and blunders to give you a detailed look at all the genuinely elegant parts of JavaScript, including:

? Syntax ? Objects ? Functions ? Inheritance ? Arrays ? Regular expressions ? Methods ? Style ? Beautiful features

The real beauty? As you move ahead with the subset of JavaScript that this book presents, you'll also sidestep the need to unlearn all the bad parts. Of course, if you want to find out more about the bad parts and how to use them badly, simply consult any other JavaScript book. With JavaScript: The Good Parts, you'll discover a beautiful, elegant, lightweight and highly expressive language that lets you create effective code, whether you're managing object libraries or just trying to get Ajax to run fast. If you develop sites or applications for the Web, this book is an absolute must.

1

2 2

1

JavaScript: The Good Parts by Douglas Crockford

Publisher: O'Reilly Pub Date: May 2, 2008 Print ISBN-13: 978-0-596-51774-8 Pages: 170 Table of Contents | Index Dedication Preface Chapter 1. Good Parts Section 1.1. Why JavaScript? Section 1.2. Analyzing JavaScript Section 1.3. A Simple Testing Ground Chapter 2. Grammar Section 2.1. Whitespace Section 2.2. Names Section 2.3. Numbers Section 2.4. Strings Section 2.5. Statements Section 2.6. Expressions Section 2.7. Literals Section 2.8. Functions Chapter 3. Objects Section 3.1. Object Literals Section 3.2. Retrieval Section 3.3. Update Section 3.4. Reference Section 3.5. Prototype Section 3.6. Reflection Section 3.7. Enumeration Section 3.8. Delete Section 3.9. Global Abatement Chapter 4. Functions Section 4.1. Function Objects Section 4.2. Function Literal Section 4.3. Invocation Section 4.4. Arguments Section 4.5. Return Section 4.6. Exceptions Section 4.7. Augmenting Types Section 4.8. Recursion Section 4.9. Scope Section 4.10. Closure Section 4.11. Callbacks Section 4.12. Module Section 4.13. Cascade Section 4.14. Curry Section 4.15. Memoization Chapter 5. Inheritance Section 5.1. Pseudoclassical Section 5.2. Object Specifiers Section 5.3. Prototypal

1

2

Section 5.4. Functional Section 5.5. Parts Chapter 6. Arrays Section 6.1. Array Literals Section 6.2. Length Section 6.3. Delete Section 6.4. Enumeration Section 6.5. Confusion Section 6.6. Methods Section 6.7. Dimensions Chapter 7. Regular Expressions Section 7.1. An Example Section 7.2. Construction Section 7.3. Elements Chapter 8. Methods Chapter 9. Style Chapter 10. Beautiful Features Appendix A. Awful Parts Section A.1. Global Variables Section A.2. Scope Section A.3. Semicolon Insertion Section A.4. Reserved Words Section A.5. Unicode Section A.6. typeof Section A.7. parseInt Section A.8. + Section A.9. Floating Point Section A.10. NaN Section A.11. Phony Arrays Section A.12. Falsy Values Section A.13. hasOwnProperty Section A.14. Object Appendix B. Bad Parts Section B.1. == Section B.2. with Statement Section B.3. eval Section B.4. continue Statement Section B.5. switch Fall Through Section B.6. Block-less Statements Section B.7. ++ -Section B.8. Bitwise Operators Section B.9. The function Statement Versus the function Expression Section B.10. Typed Wrappers Section B.11. new Section B.12. void Appendix C. JSLint Section C.1. Undefined Variables and Functions Section C.2. Members Section C.3. Options Section C.4. Semicolon Section C.5. Line Breaking Section C.6. Comma Section C.7. Required Blocks Section C.8. Forbidden Blocks

2

3 Section C.9. Expression Statements Section C.10. for in Statement Section C.11. switch Statement Section C.12. var Statement Section C.13. with Statement Section C.14. = Section C.15. == and != Section C.16. Labels Section C.17. Unreachable Code Section C.18. Confusing Pluses and Minuses Section C.19. ++ and -Section C.20. Bitwise Operators Section C.21. eval Is Evil Section C.22. void Section C.23. Regular Expressions Section C.24. Constructors and new Section C.25. Not Looked For Section C.26. HTML Section C.27. JSON Section C.28. Report Appendix D. Syntax Diagrams Appendix E. JSON Section E.1. JSON Syntax Section E.2. Using JSON Securely Section E.3. A JSON Parser Colophon Index

3

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download