...成实例的时候,使用new关键字。var obj = new Class();alert(obj.name); // 名称alert(obj.pwd); // 密码Prototype模式的验证方法 1.isPrototypeOf()
...它默认返回Object对象的一个实例 hasOwnproperty(property): 判断对象是否有某个特定的属性。必须用字符串指定该属性(o.hasOwnProperty('name')) isPrototypeOf(object): 判断该对象是否为另一个对象的原型 propertyIsEnumerable(property): 判断给定的属性是否可以用for...in语句 toString(): 返回对象...
...lse; } return false; } sortId.selectedIndex; //的到下拉列表的选中第几个 alert(Employee.prototype.isPrototypeOf(sailing));sailing是不是Emploee的对象 alert(obj.hasOwnProperty("company"));//是否有指定名称的属性 window...