{"componentChunkName":"component---src-templates-handbook-tsx","path":"/docs/handbook/release-notes/typescript-2-7.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":"44a8af7a-a27b-5211-ad62-f5e4da99f40b","excerpt":"Constant-named properties TypeScript 2.7 adds support for declaring const-named properties on types including ECMAScript symbols. Example This also applies to…","html":"<h2 id=\"constant-named-properties\" style=\"position:relative;\"><a href=\"#constant-named-properties\" aria-label=\"constant named properties 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>Constant-named properties</h2>\n<p>TypeScript 2.7 adds support for declaring const-named properties on types including ECMAScript symbols.</p>\n<h5 id=\"example\" style=\"position:relative;\"><a href=\"#example\" aria-label=\"example 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>Example</h5>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// Lib</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> SERIALIZE = Symbol(</span><span style=\"color: #A31515\">\"serialize-method-key\"</span><span style=\"color: #000000\">);</span>\n\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">interface</span><span style=\"color: #000000\"> Serializable {</span>\n<span style=\"color: #000000\">    [SERIALIZE](obj: {}): string;</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// consumer</span>\n\n<span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> { SERIALIZE, Serializable } </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"lib\"</span><span style=\"color: #000000\">;</span>\n\n<span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> JSONSerializableItem </span><span style=\"color: #0000FF\">implements</span><span style=\"color: #000000\"> Serializable {</span>\n<span style=\"color: #000000\">    [SERIALIZE](obj: {}) {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> JSON.stringify(obj);</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>This also applies to numeric and string literals.</p>\n<h5 id=\"example-1\" style=\"position:relative;\"><a href=\"#example-1\" aria-label=\"example 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>Example</h5>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> Foo = </span><span style=\"color: #A31515\">\"Foo\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> Bar = </span><span style=\"color: #A31515\">\"Bar\"</span><span style=\"color: #000000\">;</span>\n\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> x = {</span>\n<span style=\"color: #000000\">    [Foo]: </span><span style=\"color: #09835A\">100</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    [Bar]: </span><span style=\"color: #A31515\">\"hello\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">};</span>\n\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> a = x[Foo]; </span><span style=\"color: #008000\">// has type 'number'</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> b = x[Bar]; </span><span style=\"color: #008000\">// has type 'string'</span></code></div></pre>\n<h2 id=\"unique-symbol\" style=\"position:relative;\"><a href=\"#unique-symbol\" aria-label=\"unique symbol 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>unique symbol</code></h2>\n<p>To enable treating symbols as unique literals  a new type <code>unique symbol</code> is available.\n<code>unique symbol</code> is a subtype of <code>symbol</code>, and are produced only from calling <code>Symbol()</code> or <code>Symbol.for()</code>, or from explicit type annotations.\nThe new type is only allowed on <code>const</code> declarations and <code>readonly static</code> properties, and in order to reference a specific unique symbol, you’ll have to use the <code>typeof</code> operator.\nEach reference to a <code>unique symbol</code> implies a completely unique identity that’s tied to a given declaration.</p>\n<h5 id=\"example-2\" style=\"position:relative;\"><a href=\"#example-2\" aria-label=\"example 2 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>Example</h5>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// Works</span>\n<span style=\"color: #0000FF\">declare</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> Foo: unique symbol;</span>\n\n<span style=\"color: #008000\">// Error! 'Bar' isn't a constant.</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> Bar: unique symbol = Symbol();</span>\n\n<span style=\"color: #008000\">// Works - refers to a unique symbol, but its identity is tied to 'Foo'.</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> Baz: </span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> Foo = Foo;</span>\n\n<span style=\"color: #008000\">// Also works.</span>\n<span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> C {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">static</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">readonly</span><span style=\"color: #000000\"> StaticSymbol: unique symbol = Symbol();</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Because each <code>unique symbol</code> has a completely separate identity, no two <code>unique symbol</code> types are assignable or comparable to each other.</p>\n<h5 id=\"example-3\" style=\"position:relative;\"><a href=\"#example-3\" aria-label=\"example 3 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>Example</h5>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> Foo = Symbol();</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> Bar = Symbol();</span>\n\n<span style=\"color: #008000\">// Error: can't compare two unique symbols.</span>\n<span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (Foo === Bar) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #008000\">// ...</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<h2 id=\"strict-class-initialization\" style=\"position:relative;\"><a href=\"#strict-class-initialization\" aria-label=\"strict class initialization 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>Strict Class Initialization</h2>\n<p>TypeScript 2.7 introduces a new flag called <code>--strictPropertyInitialization</code>.\nThis flag performs checks to ensure that each instance property of a class gets initialized in the constructor body, or by a property initializer.\nFor example</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> C {</span>\n<span style=\"color: #000000\">    foo: number;</span>\n<span style=\"color: #000000\">    bar = </span><span style=\"color: #A31515\">\"hello\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">    baz: boolean;</span>\n<span style=\"color: #008000\">//  ~~~</span>\n<span style=\"color: #008000\">//  Error! Property 'baz' has no initializer and is not definitely assigned in the</span>\n<span style=\"color: #008000\">//         constructor.</span>\n\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">constructor</span><span style=\"color: #000000\">() {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.foo = </span><span style=\"color: #09835A\">42</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>In the above, if we truly meant for <code>baz</code> to potentially be <code>undefined</code>, we should have declared it with the type <code>boolean | undefined</code>.</p>\n<p>There are certain scenarios where properties can be initialized indirectly (perhaps by a helper method or dependency injection library), in which case you can use the new <em>definite assignment assertion modifiers</em> for your properties (discussed below).</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> C {</span>\n<span style=\"color: #000000\">    foo!: number;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #008000\">// ^</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #008000\">// Notice this '!' modifier.</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #008000\">// This is the \"definite assignment assertion\"</span>\n\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">constructor</span><span style=\"color: #000000\">() {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.initialize();</span>\n<span style=\"color: #000000\">    }</span>\n\n<span style=\"color: #000000\">    initialize() {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.foo = </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Keep in mind that <code>--strictPropertyInitialization</code> will be turned on along with other <code>--strict</code> mode flags, which can impact your project.\nYou can set the <code>strictPropertyInitialization</code> setting to <code>false</code> in your <code>tsconfig.json</code>’s <code>compilerOptions</code>, or <code>--strictPropertyInitialization false</code> on the command line to turn off this checking.</p>\n<h2 id=\"definite-assignment-assertions\" style=\"position:relative;\"><a href=\"#definite-assignment-assertions\" aria-label=\"definite assignment assertions 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>Definite Assignment Assertions</h2>\n<p>The definite assignment assertion is a feature that allows a <code>!</code> to be placed after instance property and variable declarations to relay to TypeScript that a variable is indeed assigned for all intents and purposes, even if TypeScript’s analyses cannot detect so.</p>\n<h5 id=\"example-4\" style=\"position:relative;\"><a href=\"#example-4\" aria-label=\"example 4 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>Example</h5>\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\"> x: number;</span>\n<span style=\"color: #000000\">initialize();</span>\n<span style=\"color: #000000\">console.log(x + x);</span>\n<span style=\"color: #008000\">//          ~   ~</span>\n<span style=\"color: #008000\">// Error! Variable 'x' is used before being assigned.</span>\n\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> initialize() {</span>\n<span style=\"color: #000000\">    x = </span><span style=\"color: #09835A\">10</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>With definite assignment assertions, we can assert that <code>x</code> is really assigned by appending an <code>!</code> to its declaration:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// Notice the '!'</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> x!: number;</span>\n<span style=\"color: #000000\">initialize();</span>\n\n<span style=\"color: #008000\">// No error!</span>\n<span style=\"color: #000000\">console.log(x + x);</span>\n\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> initialize() {</span>\n<span style=\"color: #000000\">    x = </span><span style=\"color: #09835A\">10</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>In a sense, the definite assignment assertion operator is the dual of the non-null assertion operator (in which <em>expressions</em> are post-fixed with a <code>!</code>), which we could also have used in the example.</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\"> x: number;</span>\n<span style=\"color: #000000\">initialize();</span>\n\n<span style=\"color: #008000\">// No error!</span>\n<span style=\"color: #000000\">console.log(x! + x!);</span>\n\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> initialize() {</span>\n<span style=\"color: #000000\">    x = </span><span style=\"color: #09835A\">10</span><span style=\"color: #000000\">;</span></code></div></pre>\n<p>In our example, we knew that all uses of <code>x</code> would be initialized so it makes more sense to use definite assignment assertions than non-null assertions.</p>\n<h2 id=\"fixed-length-tuples\" style=\"position:relative;\"><a href=\"#fixed-length-tuples\" aria-label=\"fixed length tuples 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>Fixed Length Tuples</h2>\n<p>In TypeScript 2.6 and earlier, <code>[number, string, string]</code> was considered a subtype of <code>[number, string]</code>.\nThis was motivated by TypeScript’s structural nature; the first and second elements of a <code>[number, string, string]</code> are respectively subtypes of the first and second elements of <code>[number, string]</code>.\nHowever, after examining real world usage of tuples, we noticed that most situations in which this was permitted was typically undesirable.</p>\n<p>In TypeScript 2.7, tuples of different arities are no longer assignable to each other.\nThanks to a pull request from <a href=\"https://github.com/tycho01\">Tycho Grouwstra</a>, tuple types now encode their arity into the type of their respective <code>length</code> property.\nThis is accomplished by leveraging numeric literal types, which now allow tuples to be distinct from tuples of different arities.</p>\n<p>Conceptually, you might consider the type <code>[number, string]</code> to be equivalent to the following declaration of <code>NumStrTuple</code>:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">interface</span><span style=\"color: #000000\"> NumStrTuple </span><span style=\"color: #0000FF\">extends</span><span style=\"color: #000000\"> Array&lt;number | string&gt; {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">: number;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">: string;</span>\n<span style=\"color: #000000\">    length: </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">; </span><span style=\"color: #008000\">// using the numeric literal type '2'</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Note that this is a breaking change for some code.\nIf you need to resort to the original behavior in which tuples only enforce a minimum length, you can use a similar declaration that does not explicitly define a <code>length</code> property, falling back to <code>number</code>.</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">interface</span><span style=\"color: #000000\"> MinimumNumStrTuple </span><span style=\"color: #0000FF\">extends</span><span style=\"color: #000000\"> Array&lt;number | string&gt; {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">: number;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">: string;</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Note that this does not imply tuples represent immutable arrays, but it is an implied convention.</p>\n<h2 id=\"improved-type-inference-for-object-literals\" style=\"position:relative;\"><a href=\"#improved-type-inference-for-object-literals\" aria-label=\"improved type inference for 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>Improved type inference for object literals</h2>\n<p>TypeScript 2.7 improves type inference for multiple object literals occurring in the same context.\nWhen multiple object literal types contribute to a union type, we now <em>normalize</em> the object literal types such that all properties are present in each constituent of the union type.</p>\n<p>Consider:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> obj = test ? { text: </span><span style=\"color: #A31515\">\"hello\"</span><span style=\"color: #000000\"> } : {};  </span><span style=\"color: #008000\">// { text: string } | { text?: undefined }</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> s = obj.text;  </span><span style=\"color: #008000\">// string | undefined</span></code></div></pre>\n<p>Previously type <code>{}</code> was inferred for <code>obj</code> and the second line subsequently caused an error because <code>obj</code> would appear to have no properties.\nThat obviously wasn’t ideal.</p>\n<h5 id=\"example-5\" style=\"position:relative;\"><a href=\"#example-5\" aria-label=\"example 5 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>Example</h5>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// let obj: { a: number, b: number } |</span>\n<span style=\"color: #008000\">//     { a: string, b?: undefined } |</span>\n<span style=\"color: #008000\">//     { a?: undefined, b?: undefined }</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> obj = [{ a: </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">, b: </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\"> }, { a: </span><span style=\"color: #A31515\">\"abc\"</span><span style=\"color: #000000\"> }, {}][</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">];</span>\n<span style=\"color: #000000\">obj.a;  </span><span style=\"color: #008000\">// string | number | undefined</span>\n<span style=\"color: #000000\">obj.b;  </span><span style=\"color: #008000\">// number | undefined</span></code></div></pre>\n<p>Multiple object literal type inferences for the same type parameter are similarly collapsed into a single normalized union type:</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\">function</span><span style=\"color: #000000\"> f&lt;T&gt;(...items: T[]): T;</span>\n<span style=\"color: #008000\">// let obj: { a: number, b: number } |</span>\n<span style=\"color: #008000\">//     { a: string, b?: undefined } |</span>\n<span style=\"color: #008000\">//     { a?: undefined, b?: undefined }</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> obj = f({ a: </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">, b: </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\"> }, { a: </span><span style=\"color: #A31515\">\"abc\"</span><span style=\"color: #000000\"> }, {});</span>\n<span style=\"color: #000000\">obj.a;  </span><span style=\"color: #008000\">// string | number | undefined</span>\n<span style=\"color: #000000\">obj.b;  </span><span style=\"color: #008000\">// number | undefined</span></code></div></pre>\n<h2 id=\"improved-handling-of-structurally-identical-classes-and-instanceof-expressions\" style=\"position:relative;\"><a href=\"#improved-handling-of-structurally-identical-classes-and-instanceof-expressions\" aria-label=\"improved handling of structurally identical classes and instanceof expressions 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>Improved handling of structurally identical classes and <code>instanceof</code> expressions</h2>\n<p>TypeScript 2.7 improves the handling of structurally identical classes in union types and <code>instanceof</code> expressions:</p>\n<ul>\n<li>Structurally identical, but distinct, class types are now preserved in union types (instead of eliminating all but one).</li>\n<li>Union type subtype reduction only removes a class type if it is a subclass of <em>and</em> derives from another class type in the union.</li>\n<li>Type checking of the <code>instanceof</code> operator is now based on whether the type of the left operand <em>derives from</em> the type indicated by the right operand (as opposed to a structural subtype check).</li>\n</ul>\n<p>This means that union types and <code>instanceof</code> properly distinguish between structurally identical classes.</p>\n<h5 id=\"example-6\" style=\"position:relative;\"><a href=\"#example-6\" aria-label=\"example 6 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>Example</h5>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> A {}</span>\n<span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> B </span><span style=\"color: #0000FF\">extends</span><span style=\"color: #000000\"> A {}</span>\n<span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> C </span><span style=\"color: #0000FF\">extends</span><span style=\"color: #000000\"> A {}</span>\n<span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> D </span><span style=\"color: #0000FF\">extends</span><span style=\"color: #000000\"> A { c: string }</span>\n<span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> E </span><span style=\"color: #0000FF\">extends</span><span style=\"color: #000000\"> D {}</span>\n\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> x1 = !</span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\"> ? </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> A() : </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> B();  </span><span style=\"color: #008000\">// A</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> x2 = !</span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\"> ? </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> B() : </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> C();  </span><span style=\"color: #008000\">// B | C (previously B)</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> x3 = !</span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\"> ? </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> C() : </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> D();  </span><span style=\"color: #008000\">// C | D (previously C)</span>\n\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> a1 = [</span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> A(), </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> B(), </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> C(), </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> D(), </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> E()];  </span><span style=\"color: #008000\">// A[]</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> a2 = [</span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> B(), </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> C(), </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> D(), </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> E()];  </span><span style=\"color: #008000\">// (B | C | D)[] (previously B[])</span>\n\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> f1(x: B | C | D) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (x </span><span style=\"color: #0000FF\">instanceof</span><span style=\"color: #000000\"> B) {</span>\n<span style=\"color: #000000\">        x;  </span><span style=\"color: #008000\">// B (previously B | D)</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">else</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (x </span><span style=\"color: #0000FF\">instanceof</span><span style=\"color: #000000\"> C) {</span>\n<span style=\"color: #000000\">        x;  </span><span style=\"color: #008000\">// C</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\">        x;  </span><span style=\"color: #008000\">// D (previously never)</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<h2 id=\"type-guards-inferred-from--in-operator\" style=\"position:relative;\"><a href=\"#type-guards-inferred-from--in-operator\" aria-label=\"type guards inferred from  in operator 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>Type guards inferred from  <code>in</code> operator</h2>\n<p>The <code>in</code> operator now acts as a narrowing expression for types.</p>\n<p>For a <code>n in x</code> expression, where <code>n</code> is a string literal or string literal type and <code>x</code> is a union type, the “true” branch narrows to types which have an optional or required property <code>n</code>, and the “false” branch narrows to types which have an optional or missing property <code>n</code>.</p>\n<h5 id=\"example-7\" style=\"position:relative;\"><a href=\"#example-7\" aria-label=\"example 7 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>Example</h5>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">interface</span><span style=\"color: #000000\"> A { a: number };</span>\n<span style=\"color: #0000FF\">interface</span><span style=\"color: #000000\"> B { b: string };</span>\n\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> foo(x: A | B) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (</span><span style=\"color: #A31515\">\"a\"</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">in</span><span style=\"color: #000000\"> x) {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> x.a;</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> x.b;</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<h2 id=\"support-for-import-d-from-cjs-from-commonjs-modules-with---esmoduleinterop\" style=\"position:relative;\"><a href=\"#support-for-import-d-from-cjs-from-commonjs-modules-with---esmoduleinterop\" aria-label=\"support for import d from cjs from commonjs modules with   esmoduleinterop 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>Support for <code>import d from \"cjs\"</code> from CommonJS modules with <code>--esModuleInterop</code></h2>\n<p>TypeScript 2.7 updates CommonJS/AMD/UMD module emit to synthesize namespace records based on the presence of an <code>__esModule</code> indicator under <code>--esModuleInterop</code>.\nThe change brings the generated output from TypeScript closer to that generated by Babel.</p>\n<p>Previously CommonJS/AMD/UMD modules were treated in the same way as ES6 modules, resulting in a couple of problems. Namely:</p>\n<ul>\n<li>TypeScript treats a namespace import (i.e. <code>import * as foo from \"foo\"</code>) for a CommonJS/AMD/UMD module as equivalent to <code>const foo = require(\"foo\")</code>.Things are simple here, but they don’t work out if the primary object being imported is a primitive or a class or a function. ECMAScript spec stipulates that a namespace record is a plain object, and that a namespace import (<code>foo</code> in the example above) is not callable, though allowed by TypeScript</li>\n<li>Similarly a default import (i.e. <code>import d from \"foo\"</code>) for a CommonJS/AMD/UMD module as equivalent to <code>const d = require(\"foo\").default</code>.Most of the CommonJS/AMD/UMD modules available today do not have a <code>default</code> export, making this import pattern practically unusable to import non-ES modules (i.e. CommonJS/AMD/UMD). For instance <code>import fs from \"fs\"</code> or <code>import express from \"express\"</code> are not allowed.</li>\n</ul>\n<p>Under the new <code>--esModuleInterop</code> these two issues should be addressed:</p>\n<ul>\n<li>A namespace import (i.e. <code>import * as foo from \"foo\"</code>) is now correctly flagged as uncallable. Calling it will result in an error.</li>\n<li>Default imports to CommonJS/AMD/UMD are now allowed (e.g. <code>import fs from \"fs\"</code>), and should work as expected.</li>\n</ul>\n<blockquote>\n<p>Note: The new behavior is added under a flag to avoid unwarranted breaks to existing code bases. <strong>We highly recommend applying it both to new and existing projects.</strong>\nFor existing projects, namespace imports (<code>import * as express from \"express\"; express();</code>) will need to be converted to default imports (<code>import express from \"express\"; express();</code>).</p>\n</blockquote>\n<h5 id=\"example-8\" style=\"position:relative;\"><a href=\"#example-8\" aria-label=\"example 8 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>Example</h5>\n<p>With <code>--esModuleInterop</code> two new helpers are generated <code>__importStar</code> and <code>__importDefault</code> for import <code>*</code> and import <code>default</code> respectively.\nFor instance input like:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">*</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">as</span><span style=\"color: #000000\"> foo </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"foo\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> b </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"bar\"</span><span style=\"color: #000000\">;</span></code></div></pre>\n<p>Will generate:</p>\n<pre class=\"shiki\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> __importStar = (</span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\"> && </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.__importStar) || </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (mod) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (mod && mod.__esModule) </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> mod;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> result = {};</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (mod != </span><span style=\"color: #0000FF\">null</span><span style=\"color: #000000\">) </span><span style=\"color: #0000FF\">for</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> k </span><span style=\"color: #0000FF\">in</span><span style=\"color: #000000\"> mod) </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];</span>\n<span style=\"color: #000000\">    result[</span><span style=\"color: #A31515\">\"default\"</span><span style=\"color: #000000\">] = mod;</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<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> __importDefault = (</span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\"> && </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.__importDefault) || </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (mod) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> (mod && mod.__esModule) ? mod : { </span><span style=\"color: #A31515\">\"default\"</span><span style=\"color: #000000\">: mod };</span>\n<span style=\"color: #000000\">}</span>\n<span style=\"color: #000000\">exports.__esModule = </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> foo = __importStar(require(</span><span style=\"color: #A31515\">\"foo\"</span><span style=\"color: #000000\">));</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> bar_1 = __importDefault(require(</span><span style=\"color: #A31515\">\"bar\"</span><span style=\"color: #000000\">));</span></code></div></pre>\n<h2 id=\"numeric-separators\" style=\"position:relative;\"><a href=\"#numeric-separators\" aria-label=\"numeric separators 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>Numeric separators</h2>\n<p>TypeScript 2.7 brings support for <a href=\"https://github.com/tc39/proposal-numeric-separator\">ES Numeric Separators</a>.\nNumeric literals can now be separated into segments using <code>_</code>.</p>\n<h5 id=\"example-9\" style=\"position:relative;\"><a href=\"#example-9\" aria-label=\"example 9 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>Example</h5>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> million = 1_000_000;</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> phone = 555_734_2231;</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> bytes = 0xFF_0C_00_FF;</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> word = 0b1100_0011_1101_0001;</span></code></div></pre>\n<h2 id=\"cleaner-output-in---watch-mode\" style=\"position:relative;\"><a href=\"#cleaner-output-in---watch-mode\" aria-label=\"cleaner output in   watch mode 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>Cleaner output in <code>--watch</code> mode</h2>\n<p>TypeScript’s <code>--watch</code> mode now clears the screen after a re-compilation is requested.</p>\n<h2 id=\"prettier---pretty-output\" style=\"position:relative;\"><a href=\"#prettier---pretty-output\" aria-label=\"prettier   pretty output 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>Prettier <code>--pretty</code> output</h2>\n<p>TypeScript’s <code>--pretty</code> flag can make error messages easier to read and manage.\n<code>--pretty</code> now uses colors for file names, diagnostic codes, and line numbers.\nFile names and positions are now also formatted to allow navigation in common terminals (e.g. Visual Studio Code terminal).</p>","headings":[{"value":"Constant-named properties","depth":2},{"value":"Example","depth":5},{"value":"Example","depth":5},{"value":"unique symbol","depth":2},{"value":"Example","depth":5},{"value":"Example","depth":5},{"value":"Strict Class Initialization","depth":2},{"value":"Definite Assignment Assertions","depth":2},{"value":"Example","depth":5},{"value":"Fixed Length Tuples","depth":2},{"value":"Improved type inference for object literals","depth":2},{"value":"Example","depth":5},{"value":"Improved handling of structurally identical classes and instanceof expressions","depth":2},{"value":"Example","depth":5},{"value":"Type guards inferred from  in operator","depth":2},{"value":"Example","depth":5},{"value":"Support for import d from \"cjs\" from CommonJS modules with --esModuleInterop","depth":2},{"value":"Example","depth":5},{"value":"Numeric separators","depth":2},{"value":"Example","depth":5},{"value":"Cleaner output in --watch mode","depth":2},{"value":"Prettier --pretty output","depth":2}],"frontmatter":{"permalink":"/docs/handbook/release-notes/typescript-2-7.html","title":"TypeScript 2.7"}}},"pageContext":{"slug":"/docs/handbook/release-notes/typescript-2-7.html","isOldHandbook":true}}}