@@ -1,9 +0,0 @@
-let x: number = 1;
-let y = false;
-
-function sum(a: number,b: number): number{
- return a + b;
-}
-let m: 10 | 22 | "ee"; //字面量
-let n: number | boolean; //
@@ -1,10 +1,19 @@
let a: number;
a = 4;
+function sum(a: number,b: number): number{
+ return a + b;
+}
+
+let x: number = 1;
+let y = false;
// &表示同时
let j: {name: string} & {age: number};
j = {name: 'ddd',age: 33};
+let n: number | boolean;
// 类型别名
let k: 1 | 2 | 3;
@@ -2,6 +2,9 @@
// number string boolean 字面量 any void
// unknown never object array tuple enum
+//字面量
+let xxx: 10 | 22 | "ee";
// 隐式类型any
let d;
d = 10;