let d; d = 10; d = "333"; d = true; let s: string; s = d; //any值可以赋给其他不同类型 let e: unknown; // s = e; unknown不能赋值其他 if(typeof e === "string"){ s = e; //方法1.先判断 } s = e as string //方法2.类型断言 s = <string>e //另外写法