Skip to content

Commit be15f0e

Browse files
committed
get started: content tweaks per publishing preparations
1 parent 2504a04 commit be15f0e

File tree

6 files changed

+14
-11
lines changed

6 files changed

+14
-11
lines changed

Diff for: get-started/apA.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ In my opinion, if a function exists in your program, it has a purpose; otherwise
109109

110110
If a function has a name, you the code author should include that name in the code, so that the reader does not have to infer that name from reading and mentally executing that function's source code. Even a trivial function body like `x * 2` has to be read to infer a name like "double" or "multBy2"; that brief extra mental work is unnecessary when you could just take a second to name the function "double" or "multBy2" *once*, saving the reader that repeated mental work every time it's read in the future.
111111

112-
There are, regrettably in some respects, many other function definition forms in JS as of late 2019 (maybe more in the future!).
112+
There are, regrettably in some respects, many other function definition forms in JS as of early 2020 (maybe more in the future!).
113113

114114
Here are some more declaration forms:
115115

@@ -255,7 +255,7 @@ You just can't get away from coercions in JS comparisons. Buckle down and learn
255255

256256
In Chapter 3, we introduced prototypes and showed how we can link objects through a prototype chain.
257257

258-
Another way of wiring up such prototype linkages served as the (honestly, ugly) predecessor to the elegance of the ES6 `class` system (see Chapter 2), and is referred to as prototypal classes.
258+
Another way of wiring up such prototype linkages served as the (honestly, ugly) predecessor to the elegance of the ES6 `class` system (see Chapter 2, "Classes"), and is referred to as prototypal classes.
259259

260260
| TIP: |
261261
| :--- |

Diff for: get-started/ch1.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ In these cases, often TC39 will backtrack and simply choose to conform the speci
9595

9696
But occasionally, TC39 will decide the specification should stick firm on some point even though it is unlikely that browser-based JS engines will ever conform.
9797

98-
The solution? Appendix B, "Additional ECMAScript Features for Web Browsers" (as of the time of writing, here's the ES2019 Appendix B: https://www.ecma-international.org/ecma-262/10.0/#sec-additional-ecmascript-features-for-web-browsers). The JS specification includes this appendix to detail out any known mismatches between the official JS specification and the reality of JS on the web. In other words, these are exceptions that are allowed *only* for web JS; other JS environments must stick to the letter of the law.
98+
The solution? Appendix B, "Additional ECMAScript Features for Web Browsers".[^specApB] The JS specification includes this appendix to detail out any known mismatches between the official JS specification and the reality of JS on the web. In other words, these are exceptions that are allowed *only* for web JS; other JS environments must stick to the letter of the law.
9999

100100
Section B.1 and B.2 cover *additions* to JS (syntax and APIs) that web JS includes, again for historical reasons, but which TC39 does not plan to formally specify in the core of JS. Examples include `0`-prefixed octal literals, the global `escape(..)` / `unescape(..)` utilities, String "helpers" like `anchor(..)` and `blink()`, and the RegExp `compile(..)` method.
101101

@@ -145,7 +145,7 @@ But I'll just hint at some examples of quirks that have been true at various poi
145145

146146
* How non-strict mode `this` default-binding works for function calls, and whether the "global object" used will contain expected global variables.
147147

148-
* How hoisting (see "Scope & Closures," Chapter 3) works across multiple line entries.
148+
* How hoisting (see Book 2, *Scope & Closures*) works across multiple line entries.
149149

150150
* ...several others
151151

@@ -247,7 +247,7 @@ The original snippet relied on `let` to create block-scoped `x` variables in bot
247247

248248
| NOTE: |
249249
| :--- |
250-
| The `let` keyword was added in ES6 (in 2015). The preceding example of transpiling would only need to apply if an application needed to run in a pre-ES6 supporting JS environment. The example here is just for simplicity of illustration. When ES6 was new, the need for such a transpilation was quite prevalent, but in 2019 it's much less common to need to support pre-ES6 environments. The "target" used for transpiliation is thus a sliding window that shifts upward only as decisions are made for a site/application to stop supporting some old browser/engine. |
250+
| The `let` keyword was added in ES6 (in 2015). The preceding example of transpiling would only need to apply if an application needed to run in a pre-ES6 supporting JS environment. The example here is just for simplicity of illustration. When ES6 was new, the need for such a transpilation was quite prevalent, but in 2020 it's much less common to need to support pre-ES6 environments. The "target" used for transpiliation is thus a sliding window that shifts upward only as decisions are made for a site/application to stop supporting some old browser/engine. |
251251

252252
You may wonder: why go to the trouble of using a tool to convert from a newer syntax version to an older one? Couldn't we just write the two variables and skip using the `let` keyword? The reason is, it's strongly recommended that developers use the latest version of JS so that their code is clean and communicates its ideas most effectively.
253253

@@ -474,3 +474,5 @@ JS is a multi-paradigm language, meaning the syntax and capabilities allow a dev
474474
JS is a compiled language, meaning the tools (including the JS engine) process and verify a program (reporting any errors!) before it executes.
475475

476476
With our language now *defined*, let's start getting to know its ins and outs.
477+
478+
[^specApB]: ECMAScript 2019 Language Specification, Appendix B: Additional ECMAScript Features for Web Browsers, https://www.ecma-international.org/ecma-262/10.0/#sec-additional-ecmascript-features-for-web-browsers (latest as of time of this writing in January 2020)

Diff for: get-started/ch2.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ But beware, it's more complicated than you'll assume. For example, how might you
462462

463463
### Coercive Comparisons
464464

465-
As mentioned earlier, coercion means a value of one type being converted to its respective representation in another type (to whatever extent possible). As we'll discuss in Chapter 4, coercion is a core pillar of the JS language, not some optional feature that can reasonably be avoided.
465+
Coercion means a value of one type being converted to its respective representation in another type (to whatever extent possible). As we'll discuss in Chapter 4, coercion is a core pillar of the JS language, not some optional feature that can reasonably be avoided.
466466

467467
But where coercion meets comparison operators (like equality), confusion and frustration unfortunately crop up more often than not.
468468

@@ -750,7 +750,7 @@ The `class` form stores methods and data on an object instance, which must be ac
750750

751751
With `class`, the "API" of an instance is implicit in the class definition—also, all data and methods are public. With the module factory function, you explicitly create and return an object with any publicly exposed methods, and any data or other unreferenced methods remain private inside the factory function.
752752

753-
There are other variations to this factory function form that are quite common across JS, even in 2019; you may run across these forms in different JS programs: AMD (Asynchronous Module Definition), UMD (Universal Module Definition), and CommonJS (classic Node.js-style modules). The variations, however, are minor (yet not quite compatible). Still, all of these forms rely on the same basic principles.
753+
There are other variations to this factory function form that are quite common across JS, even in 2020; you may run across these forms in different JS programs: AMD (Asynchronous Module Definition), UMD (Universal Module Definition), and CommonJS (classic Node.js-style modules). The variations, however, are minor (yet not quite compatible). Still, all of these forms rely on the same basic principles.
754754

755755
Consider also the usage (aka, "instantiation") of these module factory functions:
756756

Diff for: get-started/ch3.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ Remember: this closure is not over the value (like `1` or `3`), but over the var
261261

262262
Closure is one of the most prevalent and important programming patterns in any language. But that's especially true of JS; it's hard to imagine doing anything useful without leveraging closure in one way or another.
263263

264-
If you're still feeling unclear or shaky about closure, the majority of "Scope & Closures" (Book 2 of this series) is focused on the topic.
264+
If you're still feeling unclear or shaky about closure, the majority of Book 2, *Scope & Closures* is focused on the topic.
265265

266266
## `this` Keyword
267267

Diff for: get-started/ch4.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The second pillar of the language is the prototypes system. We covered this topi
3737

3838
JS is one of very few languages where you have the option to create objects directly and explicitly, without first defining their structure in a class.
3939

40-
For many years, people implemented the class design pattern on top of prototypes—so-called "prototypal inheritance" (see Appendix A)—and then with the advent of ES6's `class` keyword, the language doubled-down on its inclination toward OO/class-style programming.
40+
For many years, people implemented the class design pattern on top of prototypes—so-called "prototypal inheritance" (see Appendix A, "Prototypal 'Classes'")—and then with the advent of ES6's `class` keyword, the language doubled-down on its inclination toward OO/class-style programming.
4141

4242
But I think that focus has obscured the beauty and power of the prototype system: the ability for two objects to simply connect with each other and cooperate dynamically (during function/method execution) through sharing a `this` context.
4343

@@ -119,7 +119,7 @@ My suggestion for most readers is to proceed through this series in this order:
119119

120120
That's the intended order to read this book series.
121121

122-
However, books 2, 3, and 4 can generally be read in any order, depending on which topic you feel most curious about and comfortable exploring first. But I don't recommend you skip any of these three books—not even *Types & Grammar*, as some of you will be tempted to do!—even if you think you already have that topic down.
122+
However, Books 2, 3, and 4 can generally be read in any order, depending on which topic you feel most curious about and comfortable exploring first. But I don't recommend you skip any of these three books—not even *Types & Grammar*, as some of you will be tempted to do!—even if you think you already have that topic down.
123123

124124
Book 5 (*Sync & Async*) is crucial for deeply understanding JS, but if you start digging in and find it's too intimidating, this book can be deferred until you're more experienced with the language. The more JS you've written (and struggled with!), the more you'll come to appreciate this book. So don't be afraid to come back to it at a later time.
125125

Diff for: get-started/foreword.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ So, do your future self a favor and dig into this book and unlock the knowledge
1818
Because, as I found out myself, you probably don't know JavaScript (yet).
1919

2020
Brian Holt<br>
21-
Senior Program Manager on Visual Studio Code and Node.js on Azure<br>
21+
Senior Program Manager<br>
22+
Visual Studio Code and Node.js on Azure<br>
2223
Microsoft

0 commit comments

Comments
 (0)