【发布时间】:2017-09-27 22:02:54
【问题描述】:
class Book{
public title : string;
public year : number;
constructor( title :string ,year:number){
this.title = title;
this.year = year ;
}
}
var details = new Book("werr",2017);
console.log(details);
我仍然是 Typescript 的初学者。非常感谢任何帮助。
【问题讨论】:
-
你有
tsc文件吗? -
不清楚你在问什么。您是否尝试运行此代码并在命令提示符中查看结果?你试过installing the TypeScript compiler 并使用它吗?
-
是的,我试过了。并且它的编译很好。但是我怎样才能得到那个特定的 code.tsc app1.ts
标签: javascript typescript