对象概述 Objects are mutable keyed collections. An object is a container of properties, where a property has a name and a value. A property name can be any string, including the empty string. A property value can be any JavaScript value except for und
传统方式:通过function关键字来定义一个对象类型 1234567891011 function People(name) { this.name = name}People.prototype.toSay= function () { alert("我的名字是:" + this.name)}People.prototype.toEat= function () { alert("我吃饭")}var p = new People("小明")p