preface
This chapter mainly shows the main content of chapter 28 of the fourth edition of JS Little Red Book, which belongs to the page chapter and content typesetting preview. You can study sequentially, or you can study in a planned and selective way.
Chapters:
Chapter 1 What is JavaScript
An introduction to the origins of JavaScript: where it came from, how it developed, and where it stands today. This chapter covers the relationship between JavaScript and ECMAScript, the DOM, BOM, and Ecma and W3C standards.
Chapter 2 JavaScript in HTML
Learn how JavaScript can be combined with HTML to create dynamic web pages. It mainly introduces the different ways of embedding JavaScript in web pages, as well as the content types of JavaScript and their relationship to <script> elements.
Chapter 3 Language foundation
Introduces the basic concepts of the language, including syntax and flow control statements; Explain the syntactic similarities and differences between JavaScript and other C-like languages. We’ll also talk about casts when we talk about built-in operators. It also covers all primitive types, including Symbol.
Chapter 4 variables, scopes, and Memory
Explore variable handling in loosely typed JavaScript. This chapter covers the difference between primitive and reference types, as well as the execution context associated with variables. In addition, this chapter discusses garbage collection in JavaScript, involving how to reclaim memory when variables go out of scope.
Chapter 5 basic reference types
Discusses all of JavaScript’s built-in reference types, such as Date, Regexp, primitive types, and their wrapper types. Each reference type has both a theoretical explanation and an anatomy of the relevant browser implementation.
Chapter 6. Collection reference types
We continue our discussion of built-in reference types, including Object, Array, Map, WeakMap, Set, and WeakSet.
Chapter 7 iterators and Generators
Introduces two basic concepts introduced in the new VERSION of ECMAScript: iterators and generators, and discusses their basic behavior and application in the current language environment.
Chapter 8 objects, classes, and Object-oriented programming
Explains how to use classes and object-oriented programming in JavaScript. We’ll start with an in-depth discussion of JavaScript’s Object type and then prototype inheritance, followed by a full introduction to ES6 classes and their close relationship to prototype inheritance.
Chapter 9 Agency and Reflection
Introduces two closely related concepts: the Proxy and Reflect apis. Proxies and reflection are used to intercept and modify the basic operations of the language.
Chapter 10 functions
Explore one of JavaScript’s most powerful features: function expressions, which involve closures, this objects, module patterns, creating private object members, arrow functions, default arguments, and extension operators.
Chapter 11 is about scheduling and asynchronous functions
Introduces two closely related asynchronous programming constructs: the Promise type and async/await. This chapter discusses the asynchronous programming paradigm of JavaScript, and then introduces the relationship between promises and asynchronous functions.
Chapter 12 BOM
Introduces BOM, the browser object model, related to the API that interacts with the browser itself. All BOM objects are involved, including Window, Document, Location, Navigator, screen, etc.
Chapter 13 Client Detection
Explains the different means of detecting client machines and their capabilities, including capability detection and user agent string detection. This chapter discusses the pros and cons of each approach, as well as the applicable scenarios.
Chapter 14 DOM
Introduces DOM, the document Object Model, primarily the API defined by DOM Level 1. This chapter will briefly discuss XML and its relationship to the DOM, then move on to a comprehensive exploration of the DOM and how to manipulate web pages with it.
Chapter 15 DOM Extensions
Other DOM apis, including browser extensions to the DOM, are explained in terms of the Selectors API, Element Traversal API, and HTML5 extensions.
Chapter 16 DOM2 and DOM3
Build on the previous two chapters, explain the DOM Level 2 and Level 3 extensions to the DOM, including new properties, methods, and objects. This chapter also introduces DOM4 related content, such as Mutation Observer.
Chapter 17 Events
Explains the nature of events in JavaScript, as well as their origins and how they work in the DOM.
Chapter 18 Animation and Canvas Graphics
Discusses how to create dynamic graphics around the < Canvas > tag, including 2D and 3D context (WebGL) and other animation and game development basics. WebGL1 and WebGL2 are also discussed in this chapter.
Chapter 19. Form Scripts
Explore the use of JavaScript to enhance form interaction and break through browser limitations, focusing on form elements such as text boxes, selection boxes, and data validation and manipulation.
Chapter 20 JavaScript apis
Introduces various JavaScript apis, including Atomics, Encoding, File, Blob, Notifications, Streams, Timing, Web Components, and Web Cryptography.
Chapter 21 error Handling and debugging
Discusses how browsers handle errors in JavaScript code and several ways to handle errors. This chapter also covers debugging tools and techniques for each browser, including suggestions for simplifying the debugging process.
Chapter 22 deals with XML
Introduces the features of reading and manipulating XML data through JavaScript, explains the differences in features and objects supported by different browsers, and provides suggestions for simplifying cross-browser coding. This chapter also discusses using XSLT to transform XML data on the client side.
Chapter 23 JSON
It introduces JSON data formats as an alternative to XML. It also discusses how browsers parse and serialize JSON natively, as well as security considerations when using JSON.
Chapter 24 network Requests and Remote Resources
Explore common ways in which browsers request data and resources, including the early XMLHttpRequest and the modern Fetch API.
Chapter 25 client Storage
Discusses various techniques for storing data on the client machine while the application is offline. We’ll start with cookies and then discuss Web Storage and IndexedDB.
Chapter 26 modules
This paper introduces the application of module mode in coding, and then discusses the loading methods of modules before ES6 modules, including CommonJS, AMD and UMD. Finally, the new ES6 module and its correct usage are introduced.
Chapter 27 worker threads
An in-depth look at dedicated worker threads, shared worker threads, and service worker threads. These include the implementation of worker threads at the operating system and browser levels, as well as the best strategies for using various worker threads.
Chapter 28 best Practices
Explore best practices for JavaScript coding in enterprise development. It covers coding practices to improve code maintainability, including coding tips, formatting, and common coding recommendations. In-depth discussion of application performance and speed enhancing techniques. Finally, topics related to live deployment, including the project construction process, are introduced.