diff --git a/scope-closures/ch2.md b/scope-closures/ch2.md index fdb784bbb..2ffefb345 100644 --- a/scope-closures/ch2.md +++ b/scope-closures/ch2.md @@ -244,7 +244,7 @@ When *Engine* exhausts all *lexically available* scopes (moving outward) and sti If the variable is a *source*, an unresolved identifier lookup is considered an undeclared (unknown, missing) variable, which always results in a `ReferenceError` being thrown. Also, if the variable is a *target*, and the code at that moment is running in strict-mode, the variable is considered undeclared and similarly throws a `ReferenceError`. -The error message for an undeclared variable condition, in most JS environments, will look like, "Reference Error: WHATEVER is not defined." The phrase "not defined" seems almost identical to the word "undefined," as far as the English language goes. But these two are very different in JS, and this error message unfortunately creates a persistent confusion. +The error message for an undeclared variable condition, in most JS environments, will look like, "Reference Error: XYZ is not defined." The phrase "not defined" seems almost identical to the word "undefined," as far as the English language goes. But these two are very different in JS, and this error message unfortunately creates a persistent confusion. "Not defined" really means "not declared"—or, rather, "undeclared," as in a variable that has no matching formal declaration in any *lexically available* scope. By contrast, "undefined" really means a variable was found (declared), but the variable otherwise has no other value in it at the moment, so it defaults to the `undefined` value. diff --git a/scope-closures/ch4.md b/scope-closures/ch4.md index f6b4fb8df..84e77a92c 100644 --- a/scope-closures/ch4.md +++ b/scope-closures/ch4.md @@ -229,7 +229,7 @@ With the exception of some rare corner cases like DOM element ID's and `window.n ### Web Workers -Web Workers are a web platform extension for typical browser-JS behavior, which allows a JS file to run in a completely separate thread (operating system wise) from the thread that's running the main JS program. +Web Workers are a web platform extension on top of browser-JS behavior, which allows a JS file to run in a completely separate thread (operating system wise) from the thread that's running the main JS program. Since these Web Worker programs run on a separate thread, they're restricted in their communications with the main application thread, to avoid/limit race conditions and other complications. Web Worker code does not have access to the DOM, for example. Some web APIs are, however, made available to the worker, such as `navigator`.