From bf15f5d843ad8d6511ea0abab4db71171b8dcdae Mon Sep 17 00:00:00 2001 From: cssjunkie Date: Thu, 3 Aug 2017 13:19:46 -0600 Subject: [PATCH] Update ch1.md The term "global variable" was used when "global object" is called for, on line 235. --- types & grammar/ch1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types & grammar/ch1.md b/types & grammar/ch1.md index 1e0c0c651..4ca99f45b 100644 --- a/types & grammar/ch1.md +++ b/types & grammar/ch1.md @@ -232,7 +232,7 @@ if (!window.atob) { Unlike referencing undeclared variables, there is no `ReferenceError` thrown if you try to access an object property (even on the global `window` object) that doesn't exist. -On the other hand, manually referencing the global variable with a `window` reference is something some developers prefer to avoid, especially if your code needs to run in multiple JS environments (not just browsers, but server-side node.js, for instance), where the global variable may not always be called `window`. +On the other hand, manually referencing the global variable with a `window` reference is something some developers prefer to avoid, especially if your code needs to run in multiple JS environments (not just browsers, but server-side node.js, for instance), where the global object may not always be called `window`. Technically, this safety guard on `typeof` is useful even if you're not using global variables, though these circumstances are less common, and some developers may find this design approach less desirable. Imagine a utility function that you want others to copy-and-paste into their programs or modules, in which you want to check to see if the including program has defined a certain variable (so that you can use it) or not: