为了使两种得到明确的区分,开发者称第一种为“原型 (prototypes)”,第二种为“原型对象(prototype objects)”.下面的方法可以帮助我们处理原型:
基于10个网页-相关网页
Class management: Prototype includes easier creation and extension of classes and objects.
类管理:Prototype支持更轻松地创建和扩展类和对象。
The prototype for all RequiredValidator objects is a Validator instance, which has no properties because no parameters are passed to the Validator constructor.
所有RequiredValidator对象的原型都是一个Validator实例,该实例没有任何属性,因为没有参数传递给Validator构造函数。
Also note that any new objects created based on the Person prototype would have the birthdate property, making the following code valid.
还要注意基于Person原型创建的新对象都有birthdate属性,因此下面的代码是有效的。
应用推荐