Skip to content

Commit dd145b4

Browse files
committedJan 5, 2022
feat: adding typed-arrays example
1 parent d27312d commit dd145b4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎lesson2/typed-arrays.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
let carMakers: string[];
2+
const dates = [new Date(), new Date()];
3+
const carsByMake = [["f15"], ["corolla"]];
4+
5+
// Flexible types
6+
const importantDates = [new Date(), "2030-10-10"];
7+
const importantValues: (Date | string)[] = [];
8+
9+
importantValues.push("2031-10-01");

0 commit comments

Comments
 (0)
Please sign in to comment.