ts类定义和实例化
(function () { //类 var Person = /** @class */ (function () { function Person(name, age) { this.name = name; this.age = age; } return Person; }()); function sayhi(p) { console.log(p.name + " | " + p.age); } //类的实例化是new,而接口是直接用json实例化 var p = new Person('daye', 18); console.log(sayhi(p)); })();