Skip to content

Commit e0ea5c7

Browse files
type casting
Signed-off-by: ivan katliarchuk <[email protected]>
1 parent 8c63cfc commit e0ea5c7

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

2-understand/s6-advanced-types/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ run-type-guards: ## Run type guards
1010

1111
run-disc-unions: ## Run discriminated unions
1212
@deno run disc-union.ts
13+
14+
run-type-casting: ## Run type casting
15+
@deno run type-casting.ts
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// type casting
2+
// https://www.udemy.com/course/understanding-typescript/learn/lecture/16893896#overview
3+
4+
const userInputElement = document.getElementById('user-input');
5+
6+
if (userInputElement) {
7+
(userInputElement as HTMLInputElement).value = 'Hi There!';
8+
}

0 commit comments

Comments
 (0)