Add content to TypeScript roadmap

pull/3423/head
Kamran Ahmed 2 years ago
parent 659bd93094
commit d96e5890b9
  1. 2
      src/roadmaps/typescript/content/101-typescript-types/115-type-assertions/100-as-const.md
  2. 2
      src/roadmaps/typescript/content/101-typescript-types/115-type-assertions/101-as-type.md
  3. 2
      src/roadmaps/typescript/content/101-typescript-types/115-type-assertions/102-as-any.md
  4. 4
      src/roadmaps/typescript/content/101-typescript-types/115-type-assertions/103-non-null-assertion.md

@ -4,7 +4,7 @@
For example:
```
```typescript
const colors = ['red', 'green', 'blue'] as const;
// colors is now of type readonly ['red', 'green', 'blue']

@ -4,7 +4,7 @@ as is a type assertion in TypeScript that allows you to tell the compiler to tre
For example:
```
```typescript
let num = 42;
let str = num as string;

@ -4,7 +4,7 @@
For example:
```
```typescript
let anyValue: any = 42;
// we can assign any value to anyValue, regardless of its type

@ -2,9 +2,7 @@
The non-null assertion operator (!) is a type assertion in TypeScript that allows you to tell the compiler that a value will never be null or undefined.
For example:
```
```typescript
let name: string | null = null;
// we use the non-null assertion operator to tell the compiler that name will never be null

Loading…
Cancel
Save