Skip to content

Commit 43bb296

Browse files
committed
adding note about IGNORING previous first edition text in files while the titles are in progress
1 parent 2146a12 commit 43bb296

40 files changed

+245
-97
lines changed

es-next-beyond/ch1.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
Before you dive into this book, you should have a solid working proficiency over JavaScript up to the most recent standard (at the time of this writing), which is commonly called *ES5* (technically ES 5.1). Here, we plan to talk squarely about the upcoming *ES6*, as well as cast our vision beyond to understand how JS will evolve moving forward.
2529

2630
If you are still looking for confidence with JavaScript, I highly recommend you read the other titles in this series first:

es-next-beyond/ch2.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
If you've been writing JS for any length of time, odds are the syntax is pretty familiar to you. There are certainly many quirks, but overall it's a fairly reasonable and straightforward syntax that draws many similarities from other languages.
2529

2630
However, ES6 adds quite a few new syntactic forms that take some getting used to. In this chapter, we'll tour through them to find out what's in store.

es-next-beyond/ch3.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
It's one thing to write JS code, but it's another to properly organize it. Utilizing common patterns for organization and reuse goes a long way to improving the readability and understandability of your code. Remember: code is at least as much about communicating to other developers as it is about feeding the computer instructions.
2529

2630
ES6 has several important features that help significantly improve these patterns, including: iterators, generators, modules, and classes.

es-next-beyond/ch4.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
It's no secret if you've written any significant amount of JavaScript that asynchronous programming is a required skill. The primary mechanism for managing asynchrony has been the function callback.
2529

2630
However, ES6 adds a new feature that helps address significant shortcomings in the callbacks-only approach to async: *Promises*. In addition, we can revisit generators (from the previous chapter) and see a pattern for combining the two that's a major step forward in async flow control programming in JavaScript.

es-next-beyond/ch5.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
Structured collection and access to data is a critical component of just about any JS program. From the beginning of the language up to this point, the array and the object have been our primary mechanism for creating data structures. Of course, many higher-level data structures have been built on top of these, as user-land libraries.
2529

2630
As of ES6, some of the most useful (and performance-optimizing!) data structure abstractions have been added as native components of the language.

es-next-beyond/ch6.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
From conversions of values to mathematic calculations, ES6 adds many static properties and methods to various built-in natives and objects to help with common tasks. In addition, instances of some of the natives have new capabilities via various new prototype methods.
2529

2630
**Note:** Most of these features can be faithfully polyfilled. We will not dive into such details here, but check out "ES6 Shim" (https://github.com/paulmillr/es6-shim/) for standards-compliant shims/polyfills.

es-next-beyond/ch7.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
Meta programming is programming where the operation targets the behavior of the program itself. In other words, it's programming the programming of your program. Yeah, a mouthful, huh?
2529

2630
For example, if you probe the relationship between one object `a` and another `b` -- are they `[[Prototype]]` linked? -- using `a.isPrototypeOf(b)`, this is commonly referred to as introspection, a form of meta programming. Macros (which don't exist in JS, yet) -- where the code modifies itself at compile time -- are another obvious example of meta programming. Enumerating the keys of an object with a `for..in` loop, or checking if an object is an *instance of* a "class constructor", are other common meta programming tasks.

es-next-beyond/ch8.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
At the time of this writing, the final draft of ES6 (*ECMAScript 2015*) is shortly headed toward its final official vote of approval by ECMA. But even as ES6 is being finalized, the TC39 committee is already hard at work on features for ES7/2016 and beyond.
2529

2630
As we discussed in Chapter 1, it's expected that the cadence of progress for JS is going to accelerate from updating once every several years to having an official version update once per year (hence the year-based naming). That alone is going to radically change how JS developers learn about and keep up with the language.

es-next-beyond/toc.md

+44-44
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# You Don't Know JS Yet: ES.Next & Beyond
1+
# You Don't Know JS Yet: ES.Next & Beyond - 2nd Edition
22

33
| NOTE: |
44
| :--- |
@@ -9,54 +9,54 @@
99
* Foreword
1010
* Preface
1111
* Chapter 1: ES? Now & Future
12-
* Versioning
13-
* Transpiling
12+
* Versioning
13+
* Transpiling
1414
* Chapter 2: Syntax
15-
* Block-Scoped Declarations
16-
* Spread / Rest
17-
* Default Parameter Values
18-
* Destructuring
19-
* Object Literal Extensions
20-
* Template Literals
21-
* Arrow Functions
22-
* `for..of` Loops
23-
* Regular Expression Extensions
24-
* Number Literal Extensions
25-
* Unicode
26-
* Symbols
15+
* Block-Scoped Declarations
16+
* Spread / Rest
17+
* Default Parameter Values
18+
* Destructuring
19+
* Object Literal Extensions
20+
* Template Literals
21+
* Arrow Functions
22+
* `for..of` Loops
23+
* Regular Expression Extensions
24+
* Number Literal Extensions
25+
* Unicode
26+
* Symbols
2727
* Chapter 3: Organization
28-
* Iterators
29-
* Generators
30-
* Modules
31-
* Classes
28+
* Iterators
29+
* Generators
30+
* Modules
31+
* Classes
3232
* Chapter 4: Async Flow Control
33-
* Promises
34-
* Generators + Promises
33+
* Promises
34+
* Generators + Promises
3535
* Chapter 5: Collections
36-
* TypedArrays
37-
* Maps
38-
* WeakMaps
39-
* Sets
40-
* WeakSets
36+
* TypedArrays
37+
* Maps
38+
* WeakMaps
39+
* Sets
40+
* WeakSets
4141
* Chapter 6: API Additions
42-
* `Array`
43-
* `Object`
44-
* `Math`
45-
* `Number`
46-
* `String`
42+
* `Array`
43+
* `Object`
44+
* `Math`
45+
* `Number`
46+
* `String`
4747
* Chapter 7: Meta Programming
48-
* Function Names
49-
* Meta Properties
50-
* Well Known Symbols
51-
* Proxies
52-
* `Reflect` API
53-
* Feature Testing
54-
* Tail Call Optimization (TCO)
48+
* Function Names
49+
* Meta Properties
50+
* Well Known Symbols
51+
* Proxies
52+
* `Reflect` API
53+
* Feature Testing
54+
* Tail Call Optimization (TCO)
5555
* Chapter 8: Beyond ES6
56-
* `async function`s
57-
* `Object.observe(..)`
58-
* Exponentiation Operator
59-
* Object Properties and `...`
60-
* `Array#includes(..)`
61-
* SIMD
56+
* `async function`s
57+
* `Object.observe(..)`
58+
* Exponentiation Operator
59+
* Object Properties and `...`
60+
* `Array#includes(..)`
61+
* SIMD
6262
* Appendix A: TODO

getting-started/toc.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
* Iteration
2828
* Asking Why
2929
* Chapter 4: The Rest (of the Series)
30-
* In Order
3130
* Pillar 1: Scope and Closure
3231
* Pillar 2: Prototypes
3332
* Pillar 3: Types and Coercion
33+
* In Order
3434
* With The Grain
3535
* Appendix A: Practice, Practice, Practice!
3636
* TODO

objects-classes/apA.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
If there's any take-away message from the second half of this book (Chapters 4-6), it's that classes are an optional design pattern for code (not a necessary given), and that furthermore they are often quite awkward to implement in a `[[Prototype]]` language like JavaScript.
2529

2630
This awkwardness is *not* just about syntax, although that's a big part of it. Chapters 4 and 5 examined quite a bit of syntactic ugliness, from verbosity of `.prototype` references cluttering the code, to *explicit pseudo-polymorphism* (see Chapter 4) when you give methods the same name at different levels of the chain and try to implement a polymorphic reference from a lower-level method to a higher-level method. `.constructor` being wrongly interpreted as "was constructed by" and yet being unreliable for that definition is yet another syntactic ugly.

objects-classes/ch1.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
One of the most confused mechanisms in JavaScript is the `this` keyword. It's a special identifier keyword that's automatically defined in the scope of every function, but what exactly it refers to bedevils even seasoned JavaScript developers.
2529

2630
> Any sufficiently *advanced* technology is indistinguishable from magic. -- Arthur C. Clarke

objects-classes/ch2.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
In Chapter 1, we discarded various misconceptions about `this` and learned instead that `this` is a binding made for each function invocation, based entirely on its **call-site** (how the function is called).
2529

2630
## Call-site

objects-classes/ch3.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
In Chapters 1 and 2, we explained how the `this` binding points to various objects depending on the call-site of the function invocation. But what exactly are objects, and why do we need to point to them? We will explore objects in detail in this chapter.
2529

2630
## Syntax

objects-classes/ch4.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
Following our exploration of objects from the previous chapter, it's natural that we now turn our attention to "object oriented (OO) programming", with "classes". We'll first look at "class orientation" as a design pattern, before examining the mechanics of "classes": "instantiation", "inheritance" and "(relative) polymorphism".
2529

2630
We'll see that these concepts don't really map very naturally to the object mechanism in JS, and the lengths (mixins, etc.) many JavaScript developers go to overcome such challenges.

objects-classes/ch5.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
In Chapters 3 and 4, we mentioned the `[[Prototype]]` chain several times, but haven't said what exactly it is. We will now examine prototypes in detail.
2529

2630
**Note:** All of the attempts to emulate class-copy behavior, as described previously in Chapter 4, labeled as variations of "mixins", completely circumvent the `[[Prototype]]` chain mechanism we examine here in this chapter.

objects-classes/ch6.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
In Chapter 5, we addressed the `[[Prototype]]` mechanism in detail, and *why* it's confusing and inappropriate (despite countless attempts for nearly two decades) to describe it as "class" or "inheritance". We trudged through not only the fairly verbose syntax (`.prototype` littering the code), but the various gotchas (like surprising `.constructor` resolution or ugly pseudo-polymorphic syntax). We explored variations of the "mixin" approach, which many people use to attempt to smooth over such rough areas.
2529

2630
It's a common reaction at this point to wonder why it has to be so complex to do something seemingly so simple. Now that we've pulled back the curtain and seen just how dirty it all gets, it's not a surprise that most JS developers never dive this deep, and instead relegate such mess to a "class" library to handle it for them.

scope-closures/apA.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
In Chapter 2, we talked about "Dynamic Scope" as a contrast to the "Lexical Scope" model, which is how scope works in JavaScript (and in fact, most other languages).
2529

2630
We will briefly examine dynamic scope, to hammer home the contrast. But, more importantly, dynamic scope actually is a near cousin to another mechanism (`this`) in JavaScript, which we covered in the "*this & Object Prototypes*" title of this book series.

scope-closures/apB.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
In Chapter 3, we explored Block Scope. We saw that `with` and the `catch` clause are both tiny examples of block scope that have existed in JavaScript since at least the introduction of ES3.
2529

2630
But it's ES6's introduction of `let` that finally gives full, unfettered block-scoping capability to our code. There are many exciting things, both functionally and code-stylistically, that block scope will enable.

scope-closures/apC.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
Though this title does not address the `this` mechanism in any detail, there's one ES6 topic which relates `this` to lexical scope in an important way, which we will quickly examine.
2529

2630
ES6 adds a special syntactic form of function declaration called the "arrow function". It looks like this:

scope-closures/ch1.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
One of the most fundamental paradigms of nearly all programming languages is the ability to store values in variables, and later retrieve or modify those values. In fact, the ability to store values and pull values out of variables is what gives a program *state*.
2529

2630
Without such a concept, a program could perform some tasks, but they would be extremely limited and not terribly interesting.

scope-closures/ch2.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
In Chapter 1, we defined "scope" as the set of rules that govern how the *Engine* can look up a variable by its identifier name and find it, either in the current *Scope*, or in any of the *Nested Scopes* it's contained within.
2529

2630
There are two predominant models for how scope works. The first of these is by far the most common, used by the vast majority of programming languages. It's called **Lexical Scope**, and we will examine it in-depth. The other model, which is still used by some languages (such as Bash scripting, some modes in Perl, etc.) is called **Dynamic Scope**.

scope-closures/ch3.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
----
2323

24+
| NOTE: |
25+
| :--- |
26+
| Everything below here is previous text from 1st edition, and is only here for reference while 2nd edition work is underway. **Please ignore this stuff.** |
27+
2428
As we explored in Chapter 2, scope consists of a series of "bubbles" that each act as a container or bucket, in which identifiers (variables, functions) are declared. These bubbles nest neatly inside each other, and this nesting is defined at author-time.
2529

2630
But what exactly makes a new bubble? Is it only the function? Can other structures in JavaScript create bubbles of scope?

0 commit comments

Comments
 (0)