万人都要将火熄灭,我一人独将此火高高举起。——海子

分享一个插件:Code Runner可以直接运行代码,不需要复杂配置环境

image-20230108180234862

安装以后可以直接运行当前文件

image-20230108180326596

我们直接运行ts的话,还需要安装一个ts-node

1
tyarn global add ts-node

运行代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class Student {
fullName: string;
constructor(firstName: string, middleInitial: string, lastName: string) {
this.fullName = firstName + " " + middleInitial + " " + lastName;
}
}

interface Person {
firstName: string;
lastName: string;
}

function greeter(person: Person) {
return "Hello, " + person.firstName + " " + person.lastName;
}

let user = new Student("Jane", "M.", "User");

console.table(user)

image-20230108180953730