diff --git a/packages/documentation/copy/en/handbook-v2/Basics.md b/packages/documentation/copy/en/handbook-v2/Basics.md index 79b870e76501..6bc4e0f21566 100644 --- a/packages/documentation/copy/en/handbook-v2/Basics.md +++ b/packages/documentation/copy/en/handbook-v2/Basics.md @@ -388,11 +388,11 @@ to Why did this happen? Template strings are a feature from a version of ECMAScript called ECMAScript 2015 (a.k.a. ECMAScript 6, ES2015, ES6, etc. - _don't ask_). -TypeScript has the ability to rewrite code from newer versions of ECMAScript to older ones such as ECMAScript 3 or ECMAScript 5 (a.k.a. ES5). +TypeScript has the ability to rewrite code from newer versions of ECMAScript to older supported versions such as ECMAScript 2015. This process of moving from a newer or "higher" version of ECMAScript down to an older or "lower" one is sometimes called _downleveling_. -By default TypeScript targets ES5, an extremely old version of ECMAScript. -We could have chosen something a little bit more recent by using the [`target`](/tsconfig#target) option. +By default TypeScript targets the most recent supported ECMAScript version. +We could have chosen something older by using the [`target`](/tsconfig#target) option. Running with `--target es2015` changes TypeScript to target ECMAScript 2015, meaning code should be able to run wherever ECMAScript 2015 is supported. So running `tsc --target es2015 hello.ts` gives us the following output: @@ -403,15 +403,14 @@ function greet(person, date) { greet("Maddison", new Date()); ``` -> While the default target is ES5, the great majority of current browsers support ES2015. -> Most developers can therefore safely specify ES2015 or above as a target, unless compatibility with certain ancient browsers is important. +> Modern runtimes support ES2015 and newer. +> Most developers can therefore safely use a recent target unless compatibility with older browsers is important. ## Strictness Different users come to TypeScript looking for different things in a type-checker. Some people are looking for a more loose opt-in experience which can help validate only some parts of their program, and still have decent tooling. -This is the default experience with TypeScript, where types are optional, inference takes the most lenient types, and there's no checking for potentially `null`/`undefined` values. -Much like how `tsc` emits in the face of errors, these defaults are put in place to stay out of your way. +You can configure TypeScript for a looser opt-in experience where types are optional, inference takes more lenient types, and there's less checking for potentially `null`/`undefined` values. If you're migrating existing JavaScript, that might be a desirable first step. In contrast, a lot of users prefer to have TypeScript validate as much as it can straight away, and that's why the language provides strictness settings as well. diff --git a/packages/documentation/copy/en/handbook-v2/Modules.md b/packages/documentation/copy/en/handbook-v2/Modules.md index d84f9f9e7575..d78b46668851 100644 --- a/packages/documentation/copy/en/handbook-v2/Modules.md +++ b/packages/documentation/copy/en/handbook-v2/Modules.md @@ -28,7 +28,7 @@ Before we start, it's important to understand what TypeScript considers a module The JavaScript specification declares that any JavaScript files without an `import` declaration, `export`, or top-level `await` should be considered a script and not a module. -Inside a script file variables and types are declared to be in the shared global scope, and it's assumed that you'll either use the [`outFile`](/tsconfig#outFile) compiler option to join multiple input files into one output file, or use multiple `