码迷,mamicode.com
首页 > 其他好文 > 详细

摘录ECMAScript官方文档中重要的两段话

时间:2016-02-24 17:08:21      阅读:107      评论:0      收藏:0      [点我收藏+]

标签:

Every object created by a constructor has an implicit reference (called the object’s prototype) to the value of its
constructor’s "prototype" property. Furthermore, a prototype may have a non-null implicit reference to its
prototype, and so on; this is called the prototype chain. When a reference is made to a property in an object,
that reference is to the property of that name in the first object in the prototype chain that contains a property of
that name. In other words, first the object mentioned directly is examined for such a property; if that object
contains the named property, that is the property to which the reference refers; if that object does not contain
the named property, the prototype for that object is examined next; and so on.

 

In a class-based object-oriented language, in general, state is carried by instances, methods are carried by classes, and inheritance is only of structure and behaviour. In ECMAScript, the state and methods are carried by objects, while structure, behaviour, and state are all inherited.

摘录ECMAScript官方文档中重要的两段话

标签:

原文地址:http://www.cnblogs.com/shenzhigang/p/5213507.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!