typescript

Posted jentary

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了typescript相关的知识,希望对你有一定的参考价值。

class  Person {
    public name:string;
    private age:number;
    constructor(name:string,age:number){
        this.name = name;
        this.age = age;
    }
    public run(){
        return this.name+this.age
    }

}

var p = new Person(‘张三‘,40);
p.run();
p.name;

 

以上是关于typescript的主要内容,如果未能解决你的问题,请参考以下文章