1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-06 09:16:29 +02:00

Add content to TypeScript roadmap

This commit is contained in:
Kamran Ahmed
2023-02-06 21:26:16 +00:00
parent 659bd93094
commit d96e5890b9
4 changed files with 20 additions and 22 deletions

View File

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

View File

@@ -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;

View File

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

View File

@@ -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