From da526fa684284edf7170ef7e3cdcd4a1d6413cd3 Mon Sep 17 00:00:00 2001 From: boc-the-git <3479092+boc-the-git@users.noreply.github.com> Date: Mon, 11 Mar 2024 16:14:52 +1100 Subject: [PATCH] Remove duplication (#5311) --- .../101-typescript-types/115-type-assertions/101-as-type.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/roadmaps/typescript/content/101-typescript-types/115-type-assertions/101-as-type.md b/src/data/roadmaps/typescript/content/101-typescript-types/115-type-assertions/101-as-type.md index 6a6767aa9..e446798b7 100644 --- a/src/data/roadmaps/typescript/content/101-typescript-types/115-type-assertions/101-as-type.md +++ b/src/data/roadmaps/typescript/content/101-typescript-types/115-type-assertions/101-as-type.md @@ -11,8 +11,8 @@ let strLength: number = (someValue as string).length; console.log(strLength); // Outputs: 18 ``` -In this example, someValue is initially of type any, and we use the as operator to assert that it is of type string before accessing its length property. It's important to note that type assertions do not change the underlying runtime representation; they are a compile-time construct used for static type checking in TypeScript. +In this example, someValue is initially of type any, and we use the as operator to assert that it is of type string before accessing its length property. -It's important to note that type assertions do not change the runtime type of a value, and do not cause any type of conversion. They simply provide a way for the programmer to override the type inference performed by the compiler. +It's important to note that type assertions do not change the runtime type of a value, and do not cause any type of conversion. They are a compile-time construct used for static type checking in TypeScript. - [Type assertions](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#type-assertions)