js中构造函数的正确写法

js中构造函数的正确写法

由于js类的定义方法和函数的定义方法一样,所以定义类的同时就定义了构造方法。function Person(name,sex){类,同时定义构造方法this.eat=function(){类中的方法alert("e
JavaScript100