O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Secrets of the JavaScript Ninja, 2nd Ed, Video Edition

Video Description

"Essential reading for developers of any discipline ... with powerful techniques to improve your JavaScript."
Becky Huett, Big Shovel Labs

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. This Video Edition book shows you how.
Secrets of the JavaScript Ninja, Second Edition uses practical examples to clearly illustrate each core concept and technique. This completely revised edition shows you how to master key JavaScript concepts such as functions, closures, objects, prototypes, and promises. It covers APIs such as the DOM, events, and timers. You'll discover best practice techniques such as testing and cross-browser development, all taught from the perspective of skilled JavaScript practitioners.

Inside:
  • Writing more effective code with functions, objects, and closures
  • Learning to avoid JavaScript application pitfalls
  • Using regular expressions to write succinct text-processing code
  • Managing asynchronous code with promises
  • Fully revised to cover concepts from ES6 and ES7
You don't have to be a ninja to read this book—just be willing to become one. Are you ready?

John Resig is an acknowledged JavaScript authority and the creator of the jQuery library. Bear Bibeault is a web developer and author of the first edition, as well as 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.

Excellent and comprehensive insight into the magic of functions and closures for the efficient use of JavaScript.
Gerd Klevesaat, Siemens

The essential resource for moving your JavaScript skills to the next level.
David Starkey, Blum

Helps you master both the stealthy and bold techniques of modern JavaScript.
Christopher Haupt, New Relic Inc.

Table of Contents

  1. PART 1: WARMING UP
    1. Chapter 1. JavaScript is everywhere 00:08:48
    2. Chapter 1. How will JavaScript evolve? 00:03:19
    3. Chapter 1. Understanding the browser 00:09:18
    4. Chapter 1. Boosting skill transferability 00:05:16
    5. Chapter 2. Building the page at runtime 00:05:19
    6. Chapter 2. The page-building phase 00:04:46
    7. Chapter 2. Executing JavaScript code 00:07:48
    8. Chapter 2. Event handling 00:05:18
    9. Chapter 2. Registering event handlers 00:05:27
  2. PART 2: UNDERSTANDING FUNCTIONS
    1. Chapter 3. First-class functions for the novice: definitions and arguments 00:06:46
    2. Chapter 3. Callback functions 00:07:46
    3. Chapter 3. Fun with functions as objects 00:07:58
    4. Chapter 3. Defining functions 00:03:24
    5. Chapter 3. Function declarations and function expressions 00:09:12
    6. Chapter 3. Arrow functions 00:04:17
    7. Chapter 3. Arguments and function parameters 00:10:09
    8. Chapter 3. Summary 00:02:38
    9. Chapter 4. Functions for the journeyman: understanding function invocation 00:02:57
    10. Chapter 4. The arguments parameter 00:09:02
    11. Chapter 4. Invoking functions 00:09:40
    12. Chapter 4. Invocation as a constructor 00:10:47
    13. Chapter 4. Invocation with the apply and call methods 00:11:09
    14. Chapter 4. Fixing the problem of function contexts 00:09:48
    15. Chapter 5. Functions for the master: closures and scopes 00:07:22
    16. Chapter 5. Putting closures to work 00:06:59
    17. Chapter 5. Tracking code execution with execution contexts 00:07:35
    18. Chapter 5. Keeping track of identifiers with lexical environments 00:08:49
    19. Chapter 5. Understanding types of JavaScript variables 00:05:12
    20. Chapter 5. Variable definition keywords and lexical environments 00:05:13
    21. Chapter 5. Registering identifiers within lexical environments 00:09:29
    22. Chapter 5. Exploring how closures work 00:09:45
    23. Chapter 5. Summary 00:02:15
    24. Chapter 6. Functions for the future: generators and promises 00:04:59
    25. Chapter 6. Working with generator functions 00:09:15
    26. Chapter 6. Using generators 00:05:08
    27. Chapter 6. Communicating with a generator 00:05:38
    28. Chapter 6. Exploring generators under the hood 00:08:41
    29. Chapter 6. Working with promises 00:07:54
    30. Chapter 6. Diving into promises 00:07:46
    31. Chapter 6. Creating our first real-world promise 00:09:37
    32. Chapter 6. Combining generators and promises 00:10:19
    33. Chapter 6. Summary 00:02:07
  3. PART 3: DIGGING INTO OBJECTS & FORTIFYING YOUR CODE
    1. Chapter 7. Object orientation with prototypes 00:06:31
    2. Chapter 7. Object construction and prototypes 00:08:07
    3. Chapter 7. Side effects of the dynamic nature of JavaScript 00:05:18
    4. Chapter 7. Achieving inheritance 00:05:29
    5. Chapter 7. The problem of overriding the constructor property 00:05:55
    6. Chapter 7. The instanceof operator 00:04:13
    7. Chapter 7. Using JavaScript “classes” in ES6 00:05:06
    8. Chapter 7. Implementing inheritance 00:05:33
    9. Chapter 8. Controlling access to objects 00:05:25
    10. Chapter 8. Defining getters and setters 00:08:40
    11. Chapter 8. Using getters and setters to validate property values 00:04:39
    12. Chapter 8. Using proxies to control access 00:07:03
    13. Chapter 8. Using proxies for logging 00:06:51
    14. Chapter 8. Using proxies to implement negative array indexes 00:07:24
    15. Chapter 9. Dealing with collections 00:06:08
    16. Chapter 9. Adding and removing items at either end of an array 00:04:43
    17. Chapter 9. Common operations on arrays 00:13:16
    18. Chapter 9. Reusing built-in array functions 00:03:20
    19. Chapter 9. Maps 00:05:10
    20. Chapter 9 . Creating our first map 00:07:44
    21. Chapter 9. Union of sets 00:05:26
    22. Chapter 10. Wrangling regular expressions 00:04:32
    23. Chapter 10. A regular expression refresher 00:04:52
    24. Chapter 10. Terms and operators 00:11:24
    25. Chapter 10. Compiling regular expressions 00:05:55
    26. Chapter 10. Capturing matching segments 00:09:51
    27. Chapter 10. Replacing using functions 00:05:40
    28. Chapter 10. Solving common problems with regular expressions 00:08:17
    29. Chapter 11. Code modularization techniques 00:05:19
    30. Chapter 11. Using objects, closures, and immediate functions to specify modules 00:11:06
    31. Chapter 11. Modularizing JavaScript applications with AMD and CommonJS 00:08:22
    32. Chapter 11. ES6 modules 00:10:18
    33. Chapter 11. Summary 00:02:59
  4. PART 4: BROWSER RECONAISSANCE
    1. Chapter 12. Working the DOM 00:04:31
    2. Chapter 12. Converting HTML to DOM 00:09:11
    3. Chapter 12. Using DOM attributes and properties 00:03:47
    4. Chapter 12. Styling attribute headaches 00:08:04
    5. Chapter 12. Fetching computed styles 00:06:46
    6. Chapter 12. Measuring heights and widths 00:07:44
    7. Chapter 12. Minimizing layout thrashing 00:07:38
    8. Chapter 13. Surviving events 00:11:17
    9. Chapter 13. An example with only macrotasks 00:06:56
    10. Chapter 13. An example with both macro- and microtasks 00:07:11
    11. Chapter 13. Taming timers: time-outs and intervals 00:01:59
    12. Chapter 13. Timer execution within the event loop 00:10:29
    13. Chapter 13. Dealing with computationally expensive processing 00:06:12
    14. Chapter 13. Working with events 00:01:58
    15. Chapter 13. Propagating events through the DOM 00:09:57
    16. Chapter 13. Custom events 00:08:57
    17. Chapter 14. Developing cross-browser strategies 00:06:54
    18. Chapter 14. The five major development concerns 00:08:10
    19. Chapter 14. External code and markup 00:11:14
    20. Chapter 14. Regressions 00:04:38
    21. Chapter 14. Implementation strategies 00:08:52
    22. Chapter 14. Untestable browser issues 00:06:09
    23. Chapter 14. Reducing assumptions 00:05:09