Remove duplication (#5311)

pull/5327/head
boc-the-git 7 months ago committed by GitHub
parent cd6232035f
commit da526fa684
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      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)

Loading…
Cancel
Save