davidflanagan/jstdg7
关于
书籍《JavaScript: The Definitive Guide》第 7 版中的示例代码
学习与教育实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Example code from JavaScript: The Definitive Guide

This repo includes all of the numbered examples from the 7th edition of my book, plus many unnumbered examples as well. In general, if an unnumbered example defines a function that seems like it might be useful to someone, I've included it here. The code is listed below in roughly the same order as in the book. To locate code, just look below for the example number or section number that the code appears in.
This code is far more useful when studied in the context of the book in which it appears, and I'd ask you to please buy yourself a copy if you are able to. These examples are free for everyone to use.
If you discover problems with this repo, or bugs in the code, please open a GitHub issue. (Note, however, that I will not accept pull requests because I need to maintain clear copyright to the code so that I can use it in future editions of the book.)
Chapter 1: Introduction to JavaScript
- Example 1-1: Computing character frequency histograms with JavaScript
Chapter 3: Types, Values, and Variables
- §3.10.3: Destructuring Assignment
Chapter 6: Objects
- §6.7: Extending Objects
- §6.10.6: Property Getters and Setters
Chapter 7: Arrays
Chapter 8: Functions
- §8.1: Defining Functions
- §8.3.4: The Spread Operator for Function Calls
- §8.3.5: Destructuring Function Arguments into Parameters
- Example 8-1: Using functions as data
- §8.4.1 Defining Your Own Function Properties
- §8.6 Closures
- Example 8-2: Private property accessor methods using closures
- §8.7.4: The call() and apply() Methods
- §8.8.1: Processing Arrays with Functions
- §8.8.2: Higher-Order Functions
- §8.8.3: Partial Application of Functions
- §8.8.4: Memoization
Chapter 9: Classes
- Example 9-1: A simple JavaScript class
- Example 9-2: A Range class using a constructor
- Example 9-3: The Range class rewritten using class
- Example 9-4: Complex.js: a complex number class
- Example 9-5: Span.js: a simple subclass of Range
- §9.5.2: Subclasses with extends and super
- Example 9-6: TypedMap.js: a subclass of Map that checks key and value types
- Example 9-7: Histogram.js: a Set-like class implemented with delegation
- Example 9-8: Sets.js: a hierarchy of abstract and concrete set classes
Chapter 10: Modules
Chapter 11: The JavaScript Standard Library
Chapter 12: Iterators and Generators
- Example 12-1: An iterable numeric Range class
- §12.2: Implementing Iterable Objects
- §12.3.1: Generator Examples
- §12.3.2 yield* and Recursive Generators
Chapter 13: Asynchronous JavaScript
- §13.1.4: Callbacks and Events in Node
- §13.2.6: Making Promises
- Example 13-1: An asynchronous getJSON() function
- §13.2.7 Promises in Sequence
- §13.4.3: Asynchronous Generators
- §13.4.4: Implementing Asynchronous Iterators
Chapter 14: Metaprogramming
- Example 14-1: Copying properties and their attributes from one object to another
- §14.4.3: Symbol.toStringTag
- §14.4.6: Pattern-Matching Symbols
- §14.5: Template Tags
- §14.7: Proxy Objects
- identity
- readOnlyProxy
- loggingProxy
Chapter 15: JavaScript in Web Browsers
- §15.1.1: JavaScript in HTML
探索相关项目
加载中…