我知道打字稿类型不是运行时变量。但是有什么解决方法可以打印类型名称和变量吗?
type TestDto = {
active: number;
user_name: string;
};
Run Code Online (Sandbox Code Playgroud)
console.log(TestDto);
Run Code Online (Sandbox Code Playgroud)
扔 only refers to a type, but is being used as a value here.
我想根据 TS 类型创建对象属性。我想创建具有活动属性和user_name一些默认值的JS 对象
typescript ×1