{"componentChunkName":"component---src-templates-handbook-tsx","path":"/docs/handbook/release-notes/typescript-3-2.html","result":{"data":{"allSitePage":{"nodes":[{"path":"/dev-404-page/"},{"path":"/docs/handbook/advanced-types.html"},{"path":"/docs/handbook/basic-types.html"},{"path":"/docs/handbook/classes.html"},{"path":"/docs/handbook/compiler-options-in-msbuild.html"},{"path":"/docs/handbook/compiler-options.html"},{"path":"/docs/handbook/configuring-watch.html"},{"path":"/docs/handbook/declaration-merging.html"},{"path":"/docs/handbook/decorators.html"},{"path":"/docs/handbook/enums.html"},{"path":"/docs/handbook/functions.html"},{"path":"/docs/handbook/generics.html"},{"path":"/docs/handbook/integrating-with-build-tools.html"},{"path":"/docs/handbook/interfaces.html"},{"path":"/docs/handbook/iterators-and-generators.html"},{"path":"/docs/handbook/jsdoc-supported-types.html"},{"path":"/docs/handbook/jsx.html"},{"path":"/docs/handbook/literal-types.html"},{"path":"/docs/handbook/mixins.html"},{"path":"/docs/handbook/module-resolution.html"},{"path":"/docs/handbook/modules.html"},{"path":"/docs/handbook/namespaces-and-modules.html"},{"path":"/docs/handbook/namespaces.html"},{"path":"/docs/handbook/nightly-builds.html"},{"path":"/docs/handbook/project-references.html"},{"path":"/docs/handbook/symbols.html"},{"path":"/docs/handbook/"},{"path":"/docs/handbook/triple-slash-directives.html"},{"path":"/docs/handbook/type-checking-javascript-files.html"},{"path":"/docs/handbook/type-compatibility.html"},{"path":"/docs/handbook/type-inference.html"},{"path":"/docs/handbook/unions-and-intersections.html"},{"path":"/docs/handbook/utility-types.html"},{"path":"/docs/handbook/variable-declarations.html"},{"path":"/docs/handbook/writing-declaration-files.html"},{"path":"/docs/handbook/declaration-files/by-example.html"},{"path":"/docs/handbook/declaration-files/consumption.html"},{"path":"/docs/handbook/declaration-files/deep-dive.html"},{"path":"/docs/handbook/declaration-files/do-s-and-don-ts.html"},{"path":"/docs/handbook/declaration-files/introduction.html"},{"path":"/docs/handbook/declaration-files/library-structures.html"},{"path":"/docs/handbook/declaration-files/publishing.html"},{"path":"/docs/handbook/declaration-files/templates.html"},{"path":"/docs/handbook/release-notes/typescript-1-1.html"},{"path":"/docs/handbook/release-notes/typescript-1-3.html"},{"path":"/docs/handbook/release-notes/typescript-1-4.html"},{"path":"/docs/handbook/release-notes/typescript-1-5.html"},{"path":"/docs/handbook/release-notes/typescript-1-6.html"},{"path":"/docs/handbook/release-notes/typescript-1-7.html"},{"path":"/docs/handbook/release-notes/typescript-1-8.html"},{"path":"/docs/handbook/release-notes/typescript-2-0.html"},{"path":"/docs/handbook/release-notes/typescript-2-2.html"},{"path":"/docs/handbook/release-notes/typescript-2-1.html"},{"path":"/docs/handbook/release-notes/typescript-2-3.html"},{"path":"/docs/handbook/release-notes/typescript-2-4.html"},{"path":"/docs/handbook/release-notes/typescript-2-5.html"},{"path":"/docs/handbook/release-notes/typescript-2-6.html"},{"path":"/docs/handbook/release-notes/typescript-2-7.html"},{"path":"/docs/handbook/release-notes/typescript-2-8.html"},{"path":"/docs/handbook/release-notes/typescript-2-9.html"},{"path":"/docs/handbook/release-notes/typescript-3-0.html"},{"path":"/docs/handbook/release-notes/typescript-3-1.html"},{"path":"/docs/handbook/release-notes/typescript-3-2.html"},{"path":"/docs/handbook/release-notes/typescript-3-3.html"},{"path":"/docs/handbook/release-notes/typescript-3-4.html"},{"path":"/docs/handbook/release-notes/typescript-3-5.html"},{"path":"/docs/handbook/release-notes/typescript-3-6.html"},{"path":"/docs/handbook/release-notes/typescript-3-7.html"},{"path":"/docs/handbook/release-notes/typescript-3-8.html"},{"path":"/docs/handbook/asp-net-core.html"},{"path":"/docs/handbook/angular.html"},{"path":"/docs/handbook/dom-manipulation.html"},{"path":"/docs/handbook/gulp.html"},{"path":"/docs/handbook/migrating-from-javascript.html"},{"path":"/docs/handbook/react-&-webpack.html"},{"path":"/docs/handbook/react.html"},{"path":"/docs/handbook/typescript-in-5-minutes-func.html"},{"path":"/docs/handbook/typescript-in-5-minutes.html"},{"path":"/docs/handbook/typescript-in-5-minutes-oop.html"},{"path":"/docs/handbook/typescript-from-scratch.html"},{"path":"/docs/handbook/typescript-tooling-in-5-minutes.html"},{"path":"/docs/handbook/tsconfig-json.html"},{"path":"/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/global-plugin-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/global-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/module-class-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/module-function-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/module-plugin-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/module-d-ts.html"},{"path":"/docs/handbook/release-notes/overview.html"},{"path":"/tsconfig"},{"path":"/en/tsconfig"},{"path":"/ja/tsconfig"},{"path":"/vo/tsconfig"},{"path":"/play"},{"path":"/en/play"},{"path":"/es/play"},{"path":"/vo/play"},{"path":"/zh/play"},{"path":"/ja/play"},{"path":"/play/3-7/fixits/big-number-literals.ts"},{"path":"/play/3-7/fixits/const-to-let.ts"},{"path":"/play/3-7/fixits/infer-from-usage-changes.ts"},{"path":"/play/3-7/syntax-and-messaging/flattened-error-reporting.ts"},{"path":"/play/3-7/syntax-and-messaging/nullish-coalescing.ts"},{"path":"/play/3-7/syntax-and-messaging/optional-chaining.ts"},{"path":"/play/3-7/types-and-code-flow/assertion-functions.ts"},{"path":"/play/3-7/types-and-code-flow/recursive-type-references.ts"},{"path":"/play/3-7/types-and-code-flow/uncalled-function-checks.ts"},{"path":"/play/3-8/breaking-changes/checking-unions-with-index-signatures.ts"},{"path":"/play/3-8/jsdoc-improvements/accessibility-modifiers.js"},{"path":"/play/3-8/syntax-and-messaging/export-modules-from.ts"},{"path":"/play/3-8/syntax-and-messaging/private-class-fields.ts"},{"path":"/play/javascript/external-apis/typescript-with-deno.ts"},{"path":"/play/javascript/external-apis/typescript-with-node.js"},{"path":"/play/javascript/external-apis/typescript-with-web.js"},{"path":"/play/javascript/external-apis/typescript-with-webgl.js"},{"path":"/play/javascript/functions-with-javascript/function-chaining.ts"},{"path":"/play/javascript/functions-with-javascript/generic-functions.ts"},{"path":"/play/javascript/functions-with-javascript/typing-functions.ts"},{"path":"/play/javascript/helping-with-javascript/errors.ts"},{"path":"/play/javascript/helping-with-javascript/quick-fixes.ts"},{"path":"/play/javascript/javascript-essentials/code-flow.ts"},{"path":"/play/javascript/javascript-essentials/functions.ts"},{"path":"/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/play/javascript/modern-javascript/async-await.ts"},{"path":"/play/javascript/modern-javascript/immutability.ts"},{"path":"/play/javascript/modern-javascript/import-export.ts"},{"path":"/play/javascript/modern-javascript/jsdoc-support.js"},{"path":"/play/javascript/working-with-classes/classes-101.ts"},{"path":"/play/javascript/working-with-classes/generic-classes.ts"},{"path":"/play/javascript/working-with-classes/mixins.ts"},{"path":"/play/javascript/working-with-classes/this.ts"},{"path":"/play/playground/config/javascript-playgrounds.js"},{"path":"/play/playground/config/new-compiler-defaults.ts"},{"path":"/play/playground/language/automatic-type-acquisition.ts"},{"path":"/play/playground/language/fixits.ts"},{"path":"/play/playground/tooling/mobile-support.ts"},{"path":"/play/playground/tooling/sharable-urls.ts"},{"path":"/play/playground/tooling/typescript-versions.ts"},{"path":"/play/typescript/language/soundness.ts"},{"path":"/play/typescript/language/structural-typing.ts"},{"path":"/play/typescript/language/type-guards.ts"},{"path":"/play/typescript/language/type-widening-and-narrowing.ts"},{"path":"/play/typescript/language-extensions/enums.ts"},{"path":"/play/typescript/language-extensions/nominal-typing.ts"},{"path":"/play/typescript/language-extensions/types-vs-interfaces.ts"},{"path":"/play/typescript/meta-types/conditional-types.ts"},{"path":"/play/typescript/meta-types/discriminate-types.ts"},{"path":"/play/typescript/meta-types/indexed-types.ts"},{"path":"/play/typescript/meta-types/mapped-types.ts"},{"path":"/play/typescript/primitives/any.ts"},{"path":"/play/typescript/primitives/literals.ts"},{"path":"/play/typescript/primitives/union-and-intersection-types.ts"},{"path":"/play/typescript/primitives/unknown-and-never.ts"},{"path":"/play/typescript/type-primitives/built-in-utility-types.ts"},{"path":"/play/typescript/type-primitives/nullable-types.ts"},{"path":"/play/typescript/type-primitives/tuples.ts"},{"path":"/es/play/javascript/external-apis/typescript-with-deno.ts"},{"path":"/es/play/javascript/external-apis/typescript-with-node.js"},{"path":"/es/play/javascript/external-apis/typescript-with-web.js"},{"path":"/es/play/javascript/functions-with-javascript/function-chaining.ts"},{"path":"/es/play/javascript/functions-with-javascript/generic-functions.ts"},{"path":"/es/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/es/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/es/play/typescript/type-primitives/built-in-utility-types.ts"},{"path":"/es/play/typescript/type-primitives/nullable-types.ts"},{"path":"/es/play/typescript/type-primitives/tuples.ts"},{"path":"/ja/play/typescript/language-extensions/enums.ts"},{"path":"/ja/play/typescript/language-extensions/nominal-typing.ts"},{"path":"/ja/play/typescript/language-extensions/types-vs-interfaces.ts"},{"path":"/ja/play/typescript/primitives/any.ts"},{"path":"/ja/play/typescript/primitives/literals.ts"},{"path":"/ja/play/typescript/primitives/union-and-intersection-types.ts"},{"path":"/ja/play/typescript/type-primitives/built-in-utility-types.ts"},{"path":"/vo/play/javascript/javascript-essentials/code-flow.ts"},{"path":"/vo/play/javascript/javascript-essentials/functions.ts"},{"path":"/vo/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/vo/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/zh/play/javascript/external-apis/typescript-with-deno.ts"},{"path":"/zh/play/javascript/external-apis/typescript-with-node.js"},{"path":"/zh/play/javascript/external-apis/typescript-with-web.js"},{"path":"/zh/play/javascript/external-apis/typescript-with-webgl.js"},{"path":"/zh/play/javascript/functions-with-javascript/function-chaining.ts"},{"path":"/zh/play/javascript/functions-with-javascript/generic-functions.ts"},{"path":"/zh/play/javascript/functions-with-javascript/typing-functions.ts"},{"path":"/zh/play/javascript/helping-with-javascript/errors.ts"},{"path":"/zh/play/javascript/helping-with-javascript/quick-fixes.ts"},{"path":"/zh/play/javascript/javascript-essentials/code-flow.ts"},{"path":"/zh/play/javascript/javascript-essentials/functions.ts"},{"path":"/zh/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/zh/play/javascript/modern-javascript/import-export.ts"},{"path":"/zh/play/javascript/modern-javascript/jsdoc-support.js"},{"path":"/zh/play/javascript/working-with-classes/classes-101.ts"},{"path":"/zh/play/javascript/working-with-classes/generic-classes.ts"},{"path":"/zh/play/javascript/working-with-classes/mixins.ts"},{"path":"/zh/play/javascript/working-with-classes/this.ts"},{"path":"/zh/play/playground/config/javascript-playgrounds.js"},{"path":"/zh/play/playground/config/new-compiler-defaults.ts"},{"path":"/zh/play/playground/language/automatic-type-acquisition.ts"},{"path":"/zh/play/playground/language/fixits.ts"},{"path":"/zh/play/playground/tooling/mobile-support.ts"},{"path":"/zh/play/playground/tooling/sharable-urls.ts"},{"path":"/zh/play/playground/tooling/typescript-versions.ts"},{"path":"/zh/play/typescript/language/soundness.ts"},{"path":"/zh/play/typescript/language/structural-typing.ts"},{"path":"/zh/play/typescript/language/type-guards.ts"},{"path":"/zh/play/typescript/language/type-widening-and-narrowing.ts"},{"path":"/zh/play/typescript/language-extensions/enums.ts"},{"path":"/zh/play/typescript/language-extensions/nominal-typing.ts"},{"path":"/zh/play/typescript/language-extensions/types-vs-interfaces.ts"},{"path":"/zh/play/typescript/meta-types/conditional-types.ts"},{"path":"/zh/play/typescript/meta-types/discriminate-types.ts"},{"path":"/zh/play/typescript/meta-types/indexed-types.ts"},{"path":"/zh/play/typescript/meta-types/mapped-types.ts"},{"path":"/zh/play/typescript/primitives/any.ts"},{"path":"/zh/play/typescript/primitives/literals.ts"},{"path":"/zh/play/typescript/primitives/union-and-intersection-types.ts"},{"path":"/zh/play/typescript/primitives/unknown-and-never.ts"},{"path":"/zh/play/typescript/type-primitives/built-in-utility-types.ts"},{"path":"/zh/play/typescript/type-primitives/nullable-types.ts"},{"path":"/zh/play/typescript/type-primitives/tuples.ts"},{"path":"/zh/play/javascript/modern-javascript/immutability.ts"},{"path":"/zh/play/javascript/modern-javascript/async-await.ts"},{"path":"/zh/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/community"},{"path":"/es/community"},{"path":"/ja/community"},{"path":"/vo/community"},{"path":"/zh/community"},{"path":"/download"},{"path":"/es/download"},{"path":"/ja/download"},{"path":"/vo/download"},{"path":"/zh/download"},{"path":"/empty"},{"path":"/es/empty"},{"path":"/ja/empty"},{"path":"/vo/empty"},{"path":"/zh/empty"},{"path":"/"},{"path":"/es/"},{"path":"/ja/"},{"path":"/vo/"},{"path":"/zh/"},{"path":"/tools"},{"path":"/es/tools"},{"path":"/ja/tools"},{"path":"/vo/tools"},{"path":"/zh/tools"},{"path":"/why-create-typescript"},{"path":"/es/why-create-typescript"},{"path":"/ja/why-create-typescript"},{"path":"/vo/why-create-typescript"},{"path":"/zh/why-create-typescript"},{"path":"/docs/home"},{"path":"/es/docs/home"},{"path":"/ja/docs/home"},{"path":"/vo/docs/home"},{"path":"/zh/docs/home"},{"path":"/dev/playground-plugins/"},{"path":"/dev/sandbox/"},{"path":"/dev/twoslash/"},{"path":"/dev/typescript-vfs/"}]},"markdownRemark":{"id":"f7194467-e807-5053-b98c-f0a46817f41c","excerpt":"strictBindCallApply TypeScript 3.2 introduces a new --strictBindCallApply compiler option (in the --strict family of options) with which the bind, call, and…","html":"<h2 id=\"strictbindcallapply\" style=\"position:relative;\"><a href=\"#strictbindcallapply\" aria-label=\"strictbindcallapply permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>strictBindCallApply</code></h2>\n<p>TypeScript 3.2 introduces a new <code>--strictBindCallApply</code> compiler option (in the <code>--strict</code> family of options) with which the <code>bind</code>, <code>call</code>, and <code>apply</code> methods on function objects are strongly typed and strictly checked.</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> foo(a: number, b: string): string {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> a + b;</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> a = foo.apply(</span><span style=\"color: #0000FF\">undefined</span><span style=\"color: #000000\">, [</span><span style=\"color: #09835A\">10</span><span style=\"color: #000000\">]);              </span><span style=\"color: #008000\">// error: too few argumnts</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> b = foo.apply(</span><span style=\"color: #0000FF\">undefined</span><span style=\"color: #000000\">, [</span><span style=\"color: #09835A\">10</span><span style=\"color: #000000\">, </span><span style=\"color: #09835A\">20</span><span style=\"color: #000000\">]);          </span><span style=\"color: #008000\">// error: 2nd argument is a number</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> c = foo.apply(</span><span style=\"color: #0000FF\">undefined</span><span style=\"color: #000000\">, [</span><span style=\"color: #09835A\">10</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"hello\"</span><span style=\"color: #000000\">, </span><span style=\"color: #09835A\">30</span><span style=\"color: #000000\">]); </span><span style=\"color: #008000\">// error: too many arguments</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> d = foo.apply(</span><span style=\"color: #0000FF\">undefined</span><span style=\"color: #000000\">, [</span><span style=\"color: #09835A\">10</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"hello\"</span><span style=\"color: #000000\">]);     </span><span style=\"color: #008000\">// okay! returns a string</span></code></div></pre>\n<p>This is achieved by introducing two new types, <code>CallableFunction</code> and <code>NewableFunction</code>, in <code>lib.d.ts</code>. These types contain specialized generic method declarations for <code>bind</code>, <code>call</code>, and <code>apply</code> for regular functions and constructor functions, respectively. The declarations use generic rest parameters (see #24897) to capture and reflect parameter lists in a strongly typed manner. In <code>--strictBindCallApply</code> mode these declarations are used in place of the (very permissive) declarations provided by type <code>Function</code>.</p>\n<h2 id=\"caveats\" style=\"position:relative;\"><a href=\"#caveats\" aria-label=\"caveats permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Caveats</h2>\n<p>Since the stricter checks may uncover previously unreported errors, this is a breaking change in <code>--strict</code> mode.</p>\n<p>Additionally, <a href=\"https://github.com/Microsoft/TypeScript/pull/27028#issuecomment-429334450\">another caveat</a> of this new functionality is that due to certain limitations, <code>bind</code>, <code>call</code>, and <code>apply</code> can’t yet fully model generic functions or functions that have overloads.\nWhen using these methods on a generic function, type parameters will be substituted with the empty object type (<code>{}</code>), and when used on a function with overloads, only the last overload will ever be modeled.</p>\n<h2 id=\"generic-spread-expressions-in-object-literals\" style=\"position:relative;\"><a href=\"#generic-spread-expressions-in-object-literals\" aria-label=\"generic spread expressions in object literals permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Generic spread expressions in object literals</h2>\n<p>In TypeScript 3.2, object literals now allow generic spread expressions which now produce intersection types, similar to the <code>Object.assign</code> function and JSX literals. For example:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> taggedObject&lt;T, U </span><span style=\"color: #0000FF\">extends</span><span style=\"color: #000000\"> string&gt;(obj: T, tag: U) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> { ...obj, tag };  </span><span style=\"color: #008000\">// T & { tag: U }</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> x = taggedObject({ x: </span><span style=\"color: #09835A\">10</span><span style=\"color: #000000\">, y: </span><span style=\"color: #09835A\">20</span><span style=\"color: #000000\"> }, </span><span style=\"color: #A31515\">\"point\"</span><span style=\"color: #000000\">);  </span><span style=\"color: #008000\">// { x: number, y: number } & { tag: \"point\" }</span></code></div></pre>\n<p>Property assignments and non-generic spread expressions are merged to the greatest extent possible on either side of a generic spread expression. For example:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> foo1&lt;T&gt;(t: T, obj1: { a: string }, obj2: { b: string }) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> { ...obj1, x: </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">, ...t, ...obj2, y: </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\"> };  </span><span style=\"color: #008000\">// { a: string, x: number } & T & { b: string, y: number }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Non-generic spread expressions continue to be processed as before: Call and construct signatures are stripped, only non-method properties are preserved, and for properties with the same name, the type of the rightmost property is used. This contrasts with intersection types which concatenate call and construct signatures, preserve all properties, and intersect the types of properties with the same name. Thus, spreads of the same types may produce different results when they are created through instantiation of generic types:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> spread&lt;T, U&gt;(t: T, u: U) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> { ...t, ...u };  </span><span style=\"color: #008000\">// T & U</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">declare</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> x: { a: string, b: number };</span>\n<span style=\"color: #0000FF\">declare</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> y: { b: string, c: boolean };</span>\n\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> s1 = { ...x, ...y };  </span><span style=\"color: #008000\">// { a: string, b: string, c: boolean }</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> s2 = spread(x, y);    </span><span style=\"color: #008000\">// { a: string, b: number } & { b: string, c: boolean }</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> b1 = s1.b;  </span><span style=\"color: #008000\">// string</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> b2 = s2.b;  </span><span style=\"color: #008000\">// number & string</span></code></div></pre>\n<h2 id=\"generic-object-rest-variables-and-parameters\" style=\"position:relative;\"><a href=\"#generic-object-rest-variables-and-parameters\" aria-label=\"generic object rest variables and parameters permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Generic object rest variables and parameters</h2>\n<p>TypeScript 3.2 also allows destructuring a rest binding from a generic variable. This is achieved by using the predefined <code>Pick</code> and <code>Exclude</code> helper types from <code>lib.d.ts</code>, and using the generic type in question as well as the names of the other bindings in the destructuring pattern.</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> excludeTag&lt;T </span><span style=\"color: #0000FF\">extends</span><span style=\"color: #000000\"> { tag: string }&gt;(obj: T) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> { tag, ...rest } = obj;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> rest;  </span><span style=\"color: #008000\">// Pick&lt;T, Exclude&lt;keyof T, \"tag\"&gt;&gt;</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> taggedPoint = { x: </span><span style=\"color: #09835A\">10</span><span style=\"color: #000000\">, y: </span><span style=\"color: #09835A\">20</span><span style=\"color: #000000\">, tag: </span><span style=\"color: #A31515\">\"point\"</span><span style=\"color: #000000\"> };</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> point = excludeTag(taggedPoint);  </span><span style=\"color: #008000\">// { x: number, y: number }</span></code></div></pre>\n<h2 id=\"bigint\" style=\"position:relative;\"><a href=\"#bigint\" aria-label=\"bigint permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>BigInt</h2>\n<p>BigInts are part of an upcoming proposal in ECMAScript that allow us to model theoretically arbitrarily large integers.\nTypeScript 3.2 brings type-checking for BigInts, as well as support for emitting BigInt literals when targeting <code>esnext</code>.</p>\n<p>BigInt support in TypeScript introduces a new primitive type called the <code>bigint</code> (all lowercase).\nYou can get a <code>bigint</code> by calling the <code>BigInt()</code> function or by writing out a BigInt literal by adding an <code>n</code> to the end of any integer numeric literal:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> foo: bigint = BigInt(</span><span style=\"color: #09835A\">100</span><span style=\"color: #000000\">); </span><span style=\"color: #008000\">// the BigInt function</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> bar: bigint = 100n;        </span><span style=\"color: #008000\">// a BigInt literal</span>\n\n<span style=\"color: #008000\">// *Slaps roof of fibonacci function*</span>\n<span style=\"color: #008000\">// This bad boy returns ints that can get *so* big!</span>\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> fibonacci(n: bigint) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> result = 1n;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">for</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> last = 0n, i = 0n; i &lt; n; i++) {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> current = result;</span>\n<span style=\"color: #000000\">        result += last;</span>\n<span style=\"color: #000000\">        last = current;</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> result;</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #000000\">fibonacci(10000n)</span></code></div></pre>\n<p>While you might imagine close interaction between <code>number</code> and <code>bigint</code>, the two are separate domains.</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">declare</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> foo: number;</span>\n<span style=\"color: #0000FF\">declare</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> bar: bigint;</span>\n\n<span style=\"color: #000000\">foo = bar; </span><span style=\"color: #008000\">// error: Type 'bigint' is not assignable to type 'number'.</span>\n<span style=\"color: #000000\">bar = foo; </span><span style=\"color: #008000\">// error: Type 'number' is not assignable to type 'bigint'.</span></code></div></pre>\n<p>As specified in ECMAScript, mixing <code>number</code>s and <code>bigint</code>s in arithmetic operations is an error.\nYou’ll have to explicitly convert values to <code>BigInt</code>s.</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #000000\">console.log(</span><span style=\"color: #09835A\">3.141592</span><span style=\"color: #000000\"> * 10000n);     </span><span style=\"color: #008000\">// error</span>\n<span style=\"color: #000000\">console.log(</span><span style=\"color: #09835A\">3145</span><span style=\"color: #000000\"> * 10n);            </span><span style=\"color: #008000\">// error</span>\n<span style=\"color: #000000\">console.log(BigInt(</span><span style=\"color: #09835A\">3145</span><span style=\"color: #000000\">) * 10n);    </span><span style=\"color: #008000\">// okay!</span></code></div></pre>\n<p>Also important to note is that <code>bigint</code>s produce a new string when using the <code>typeof</code> operator: the string <code>\"bigint\"</code>.\nThus, TypeScript correctly narrows using <code>typeof</code> as you’d expect.</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> whatKindOfNumberIsIt(x: number | bigint) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> x === </span><span style=\"color: #A31515\">\"bigint\"</span><span style=\"color: #000000\">) {</span>\n<span style=\"color: #000000\">        console.log(</span><span style=\"color: #A31515\">\"'x' is a bigint!\"</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">else</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">        console.log(</span><span style=\"color: #A31515\">\"'x' is a floating-point number\"</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>We’d like to extend a huge thanks to <a href=\"https://github.com/calebsander\">Caleb Sander</a> for all the work on this feature.\nWe’re grateful for the contribution, and we’re sure our users are too!</p>\n<h2 id=\"caveats-1\" style=\"position:relative;\"><a href=\"#caveats-1\" aria-label=\"caveats 1 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Caveats</h2>\n<p>As we mentioned, BigInt support is only available for the <code>esnext</code> target.\nIt may not be obvious, but because BigInts have different behavior for mathematical operators like <code>+</code>, <code>-</code>, <code>*</code>, etc., providing functionality for older targets where the feature doesn’t exist (like <code>es2017</code> and below) would involve rewriting each of these operations.\nTypeScript would need to dispatch to the correct behavior depending on the type, and so every addition, string concatenation, multiplication, etc. would involve a function call.</p>\n<p>For that reason, we have no immediate plans to provide downleveling support.\nOn the bright side, Node 11 and newer versions of Chrome already support this feature, so you’ll be able to use BigInts there when targeting <code>esnext</code>.</p>\n<p>Certain targets may include a polyfill or BigInt-like runtime object.\nFor those purposes you may want to add <code>esnext.bigint</code> to the <code>lib</code> setting in your compiler options.</p>\n<h2 id=\"non-unit-types-as-union-discriminants\" style=\"position:relative;\"><a href=\"#non-unit-types-as-union-discriminants\" aria-label=\"non unit types as union discriminants permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Non-unit types as union discriminants</h2>\n<p>TypeScript 3.2 makes narrowing easier by relaxing rules for what it considers a discriminant property.\nCommon properties of unions are now considered discriminants as long as they contain <em>some</em> singleton type (e.g. a string literal, <code>null</code>, or <code>undefined</code>), and they contain no generics.</p>\n<p>As a result, TypeScript 3.2 considers the <code>error</code> property in the following example to be a discriminant, whereas before it wouldn’t since <code>Error</code> isn’t a singleton type.\nThanks to this, narrowing works correctly in the body of the <code>unwrap</code> function.</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> Result&lt;T&gt; =</span>\n<span style=\"color: #000000\">    | { error: Error; data: null }</span>\n<span style=\"color: #000000\">    | { error: null; data: T };</span>\n\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> unwrap&lt;T&gt;(result: Result&lt;T&gt;) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (result.error) {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #008000\">// Here 'error' is non-null</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">throw</span><span style=\"color: #000000\"> result.error;</span>\n<span style=\"color: #000000\">    }</span>\n\n<span style=\"color: #000000\">    </span><span style=\"color: #008000\">// Now 'data' is non-null</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> result.data;</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<h2 id=\"tsconfigjson-inheritance-via-nodejs-packages\" style=\"position:relative;\"><a href=\"#tsconfigjson-inheritance-via-nodejs-packages\" aria-label=\"tsconfigjson inheritance via nodejs packages permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>tsconfig.json</code> inheritance via Node.js packages</h2>\n<p>TypeScript 3.2 now resolves <code>tsconfig.json</code>s from <code>node_modules</code>. When using a bare path for the <code>\"extends\"</code> field in <code>tsconfig.json</code>, TypeScript will dive into <code>node_modules</code> packages for us.</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"extends\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\"@my-team/tsconfig-base\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"include\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"./**/*\"</span><span style=\"color: #000000\">]</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"compilerOptions\"</span><span style=\"color: #CD3131\">:</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #008000\">// Override certain options on a project-by-project basis.</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0451A5\">\"strictBindCallApply\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">false</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Here, TypeScript will climb up <code>node_modules</code> folders looking for a <code>@my-team/tsconfig-base</code> package. For each of those packages, TypeScript will first check whether <code>package.json</code> contains a <code>\"tsconfig\"</code> field, and if it does, TypeScript will try to load a configuration file from that field. If neither exists, TypeScript will try to read from a <code>tsconfig.json</code> at the root. This is similar to the lookup process for <code>.js</code> files in packages that Node uses, and the <code>.d.ts</code> lookup process that TypeScript already uses.</p>\n<p>This feature can be extremely useful for bigger organizations, or projects with lots of distributed dependencies.</p>\n<h2 id=\"the-new---showconfig-flag\" style=\"position:relative;\"><a href=\"#the-new---showconfig-flag\" aria-label=\"the new   showconfig flag permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>The new <code>--showConfig</code> flag</h2>\n<p><code>tsc</code>, the TypeScript compiler, supports a new flag called <code>--showConfig</code>.\nWhen running <code>tsc --showConfig</code>, TypeScript will calculate the effective <code>tsconfig.json</code> (after calculating options inherited from the <code>extends</code> field) and print that out.\nThis can be useful for diagnosing configuration issues in general.</p>\n<h2 id=\"objectdefineproperty-declarations-in-javascript\" style=\"position:relative;\"><a href=\"#objectdefineproperty-declarations-in-javascript\" aria-label=\"objectdefineproperty declarations in javascript permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>Object.defineProperty</code> declarations in JavaScript</h2>\n<p>When writing in JavaScript files (using <code>allowJs</code>), TypeScript now recognizes declarations that use <code>Object.defineProperty</code>.\nThis means you’ll get better completions, and stronger type-checking when enabling type-checking in JavaScript files (by turning on the <code>checkJs</code> option or adding a <code>// @ts-check</code> comment to the top of your file).</p>\n<pre class=\"shiki\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #008000\">// @ts-check</span>\n\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> obj = {};</span>\n<span style=\"color: #000000\">Object.defineProperty(obj, </span><span style=\"color: #A31515\">\"x\"</span><span style=\"color: #000000\">, { value: </span><span style=\"color: #A31515\">\"hello\"</span><span style=\"color: #000000\">, writable: </span><span style=\"color: #0000FF\">false</span><span style=\"color: #000000\"> });</span>\n\n<span style=\"color: #000000\">obj.x.toLowercase();</span>\n<span style=\"color: #008000\">//    ~~~~~~~~~~~</span>\n<span style=\"color: #008000\">//    error:</span>\n<span style=\"color: #008000\">//     Property 'toLowercase' does not exist on type 'string'.</span>\n<span style=\"color: #008000\">//     Did you mean 'toLowerCase'?</span>\n\n<span style=\"color: #000000\">obj.x = </span><span style=\"color: #A31515\">\"world\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #008000\">//  ~</span>\n<span style=\"color: #008000\">//  error:</span>\n<span style=\"color: #008000\">//   Cannot assign to 'x' because it is a read-only property.</span></code></div></pre>","headings":[{"value":"strictBindCallApply","depth":2},{"value":"Caveats","depth":2},{"value":"Generic spread expressions in object literals","depth":2},{"value":"Generic object rest variables and parameters","depth":2},{"value":"BigInt","depth":2},{"value":"Caveats","depth":2},{"value":"Non-unit types as union discriminants","depth":2},{"value":"tsconfig.json inheritance via Node.js packages","depth":2},{"value":"The new --showConfig flag","depth":2},{"value":"Object.defineProperty declarations in JavaScript","depth":2}],"frontmatter":{"permalink":"/docs/handbook/release-notes/typescript-3-2.html","title":"TypeScript 3.2"}}},"pageContext":{"slug":"/docs/handbook/release-notes/typescript-3-2.html","isOldHandbook":true}}}