点击运行
interface Person { age:number } interface Musician extends Person { instrument:string } var drummer =
{}; drummer.age = 27 drummer.instrument = "Drums" console.log("年龄: "+drummer.age) console.log("喜欢的乐器: "+drummer.instrument)
运行结果 :
正在执行...