Secrets of the JavaScript Ninja - John Resig, Bear Bibeault, Josip Maras

Secrets of the JavaScript Ninja

Buch | Softcover
375 Seiten
2016 | 2nd
Manning Publications (Verlag)
978-1-61729-285-9 (ISBN)
35,20 inkl. MwSt
  • Titel ist leider vergriffen;
    keine Neuauflage
  • Artikel merken
Written for readers familiar with JavaScript who want to take the next step toward ninjahood.
More than ever, the web is a universal platform for all types of applications, and JavaScript is the language of the web. If you're serious about web development, it's not enough to be a decent JavaScript coder.

You need to be ninja-stealthy, efficient, and ready for anything.

Secrets of the JavaScript Ninja, Second Edition takes you below the surface and helps you understand the deceptively-complex world of JavaScript and browser-based application development.

You'll skip the basics, and dive into core JavaScript concepts such as functions, closures, objects, prototypes, promises, and so on. With examples, illustrations, and insightful explanations, you'll benefit from the collective wisdom of seasoned experts John Resig, Bear Bibeault, and Josip Maras.

Discover how the individual parts of a web application come together on the browser as a platform
Learn how functions, objects, and closures work in JavaScript and how you can use them to write simpler, more effective code
Anticipate common application pitfalls and discover how to avoid them
Write succinct code for text processing with regular expressions
Manage asynchronous code with promises
Use arrays efficiently, with a focus on succinct functionally-oriented API methods
Embrace the concepts from ES6
Grok the browser infrastructure for events, timers, web workers, and the DOM so you can write more performant applications
Understand the difficulty of cross-browser development and learn techniques for developing cross-browser strategies

John Resig is an acknowledged JavaScript authority and the creator of the jQuery library.

Bear Bibeault is a web developer and coauthor of Ajax in Practice, Prototype and Scriptaculous in Action, and jQuery in Action from Manning.

Josip Maras is a post-doctoral researcher and teacher whose thesis on automating reuse in web application development included implementing a JavaScript interpreter in JavaScript.

1. Enter the Ninja
1.1. Understanding the JavaScript language
1.1.1. History and the current state of JavaScript
1.2. Understanding the browser
1.3. Current best practices
1.3.1. Debugging
1.3.2. Testing
1.3.3. Performance analysis
1.4. Skill transferability
1.5. Summary
2. Building the page at runtime
2.1. The lifecycle overview
2.2. The page building phase
2.2.1. Parsing the HTML and building the DOM
2.2.2. Executing JavaScript code
2.3. Event handling
2.3.1. Event handling overview
2.3.2. Registering event handlers
2.3.3. Handling events
2.4. Summary
2.5. Exercises
Part 2: Understanding functions
3. First-class functions for the Novice: Definitions and arguments
3.1. What's with the functional difference?
3.1.1. Functions as first-class objects
3.1.2. Callback functions
3.2. Fun with functions as objects
3.2.1. Storing functions
3.2.2. Self-memoizing functions
3.3. Defining functions
3.3.1. Function declarations and function expressions
3.3.2. Arrow functions
3.4. Arguments and function parameters
3.4.1. Rest parameters
3.4.2. Default parameters
3.5. Summary
3.6. Exercises
4. Functions for the Journeyman: Understanding function invocation
4.1. Implicit function parameters
4.1.1. The arguments parameter
4.1.2. The this parameter: introducing the function context
4.2. Invoking functions
4.2.1. Invocation as a function
4.2.2. Invocation as a method
4.2.3. Invoking functions as constructors
4.2.4. Invocation with the apply and call methods
4.3. Fixing the problem of function contexts
4.3.1. Using arrow functions to get around function contexts
4.3.2. Using the bind method
4.4. Summary
4.5. Exercises
5. Functions for the Master: Closures and Scopes
5.1. What are closures
5.2. Putting closures to work
5.2.1. Mimicking private variables
5.2.2. Closures and callbacks
5.3. Tracking code execution with execution contexts
5.4. Keeping track of identifiers with lexical environments
5.5. Understanding different types of JavaScript variables
5.5.1. Variable mutability
5.5.2. Variable definition keywords and lexical environments
5.5.3. Registering identifiers within lexical environments
5.6. Understanding closures
5.7. Summary
5.8. Exercises
6. Functions for the future: Generators and Promises
6.1. Generators and promises make our async code elegant
6.2. Generator functions
6.2.1. Controlling the generator through the iterator object
6.2.2. Using generators
6.2.3. Communicating with a generator
6.2.4. Generator under the hood
6.3. Promises
6.3.1. The problems with simple callbacks
6.3.2. Diving into promises
6.3.3. Rejecting promises
6.3.4. Creating our first real-world promise
6.3.5. Chaining promises
6.3.6. Waiting for a number of promises
6.4. Combining generators and promises
6.4.1. Looking onward to ES7 — async functions
6.5. Summary
6.6. Exercises
Part 3: Digging into objects & fortifying your code
7. Object-orientation with prototypes
7.1. What are prototypes?
7.2. Object construction and prototypes
7.2.1. Instance properties
7.2.2. Dynamicity caveats
7.2.3. Object typing via constructors
7.3. Inheritance
7.3.1. The problem of overriding the constructor property
7.3.2. The instanceof operator
7.4. JavaScript "classes" in ES6
7.4.1. Using the class keyword
7.4.2. Implementing inheritance
7.5. Summary
7.6. Exercises
8. Guarding access to objects
8.1. Controlling access to properties with getters and setters
8.1.1. Defining getters and setters
8.1.2. Using getters and setters to validate property values
8.1.3. Using getters and setters to define computed properties
8.2. Proxies
8.2.1. Using proxies for logging
8.2.2. Using proxies for measuring performance
8.2.3. Using proxies to auto-populate properties
8.2.4. Using proxies to implement negative array indexes
8.2.5. Performance costs of proxies
8.3. Summary
9. Dealing with collections
9.1. Arrays
9.1.1. Creating arrays
9.1.2. Adding and removing array items
9.1.3. Common operations on array
9.1.4. Reusing built-in array functions
9.2. Maps
9.2.1. Don't use objects as maps
9.2.2. Creating our first Map
9.2.3. Iterating over maps
9.3. Sets
9.3.1. Creating our first Set
9.3.2. Union of sets
9.3.3. Intersection of sets
9.3.4. Difference of sets
9.4. Summary
10. Wrangling regular expressions
10.1. Why regular expressions rock
10.2. A regular expression refresher
10.2.1. Regular expressions explained
10.2.2. Terms and operators
10.3. Compiling regular expressions
10.4. Capturing matching segments
10.4.1. Performing simple captures
10.4.2. Matching using global expressions
10.4.3. Referencing captures
10.4.4. Non-capturing groups
10.5. Replacing using functions
10.6. Solving common problems with regular expressions
10.6.1. Matching newlines
10.6.2. Unicode
10.6.3. Escaped characters
10.7. Summary
10.8. Exercises
11. Code modularization techniques
11.1. Modularizing code in pre-ES6 JavaScript
11.1.1. Using objects, closures, and immediate functions to specify modules
11.1.2. Modularizing JavaScript applications with AMD and CommonJS
11.2. ES6 modules
11.2.1. Exporting and importing functionality
11.3. Summary
11.4. Exercises
Part 4: Browser Reconnaissance
12. Working the DOM
12.1. Injecting HTML into the DOM
12.1.1. Converting HTML to DOM
12.1.2. Inserting into the document
12.2. DOM attributes and properties
12.3. Styling attribute headaches
12.3.1. Where are my styles?
12.3.2. Style property naming
12.3.3. Fetching computed styles
12.3.4. Conversion of pixel values
12.3.5. Measuring heights and widths
12.4. Layout trashing
12.5. Summary
12.6. Exercises
13. Surviving events
13.1. Diving into the event loop
13.2. Taming timers: Timeouts and Intervals
13.2.1. Timer execution within the event loop
13.2.2. Dealing with computationally expensive processing
13.3. Working with events
13.3.1. Propagating events through the DOM
13.3.2. Custom events
13.4. Summary
13.5. Exercises
14. Developing cross-browser strategies
14.1. Cross-browser considerations
14.2. The five major development concerns
14.2.1. Browser bugs and differences
14.2.2. Browser bug fixes
14.2.3. Living with external code and markup
14.2.4. Regressions
14.3. Implementation strategies
14.3.1. Safe cross-browser fixes
14.3.2. Feature detection and polyfills
14.3.3. Untestable browser issues
14.4. Reducing assumptions
14.5. Summary
14.6. Exercises
Appendixes
Appendix A: Additional ES6 features
A.1. Template literals
A.2. Destructuring
A.3. Enhanced object literals
Appendix B: Arming with testing and debugging
B.1. Web Developer tools
B.2. Debugging code
B.2.1. Logging
B.2.2. Breakpoints
B.3. Creating tests
B.4. The fundamentals of a testing framework
B.4.1. The assertion
B.4.2. Popular testing frameworks
Appendix C: Exercise answers
C.1. Chapter 1. Enter the Ninja
C.2. Chapter 2. Building the page at runtime
C.3. Chapter 3. First-class functions for the Novice: Definitions and arguments
C.4. Chapter 4. Functions for the Journeyman: Understanding function invocation
C.5. Chapter 5. Functions for the Master: Closures and scopes
C.6. Chapter 6. Functions for the future: Generators and Promises
C.7. Chapter 7. Object orientation with prototypes
C.8. Chapter 8. Guarding access to objects
C.9. Chapter 9. Dealing with collections
C.10. Chapter 10. Wrangling regular expressions
C.11. Chapter 11. Code modularization techniques
C.12. Chapter 12. Working the DOM
C.13. Chapter 13. Surviving events
C.14. Chapter 14. Developing cross-browser strategies

Erscheinungsdatum
Zusatzinfo illustrations
Verlagsort New York
Sprache englisch
Gewicht 771 g
Einbandart kartoniert
Themenwelt Mathematik / Informatik Informatik Netzwerke
Informatik Office Programme Outlook
Mathematik / Informatik Informatik Programmiersprachen / -werkzeuge
Informatik Software Entwicklung Objektorientierung
Informatik Web / Internet JavaScript
Informatik Web / Internet Web Design / Usability
Informatik Weitere Themen Smartphones / Tablets
Schlagworte JavaScript • Webdesign • Webentwicklung
ISBN-10 1-61729-285-0 / 1617292850
ISBN-13 978-1-61729-285-9 / 9781617292859
Zustand Neuware
Haben Sie eine Frage zum Produkt?
Mehr entdecken
aus dem Bereich