企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# class类的使用 ``` // Person 类 class Person { constructor(name, age) { this.name = name; this.age = age; } // 原型上的方法 say() { console.log("我是原型上的方法"); } // 实例对象上的方法 static sayHi(){ console.log("我是实例上的方法"); } } // 实例化对象 var per = new Person("wc",3); console.log(per.name); console.log(per.age); per.say();//原型上的方法 Person.sayHi();//实例对象上的方法 ```