中文字幕日韩一区二区_国产一区二区av_国产毛片av_久久久久国产一区_色婷婷电影_国产一区二区精品

Javascript 對象的解釋

所有的構(gòu)造器都是對象,而并非所有的對象都是構(gòu)造器.每個(gè)構(gòu)造器都有一個(gè)用來實(shí)現(xiàn)原型繼承、共享屬性的Prototype屬性。對象通過new 表達(dá)式創(chuàng)建;比如,new String("A String") 創(chuàng)建了一個(gè)String對象。沒有通過new而直接調(diào)用構(gòu)造器將有返回值,返回的類型將取決于構(gòu)造器。例如String("A String")產(chǎn)生一個(gè)原始的類型的字符串而不是一個(gè)對象。
ECMAScript支持基于原型的繼承。每個(gè)構(gòu)造器都有一個(gè)與之關(guān)聯(lián)的原型,而且通過此構(gòu)造器創(chuàng)建的對象都有一個(gè)與構(gòu)造器原型關(guān)聯(lián)的隱式引用(稱為,對象的原型)。進(jìn)一步說,一個(gè)原型可能有一個(gè)對其原型的非空隱式引用……,這被稱為,原型鏈。當(dāng)一個(gè)引用指向?qū)ο蟮膶傩裕@個(gè)引用指向原型鏈中的第一個(gè)對象的以此為名的屬性。換句話說,第一次,這個(gè)直接關(guān)聯(lián)的對象,將為這個(gè)屬性被檢查。如果這個(gè)對象包含以此為名的屬性,這個(gè)屬性就是引用指向的屬性。如過這個(gè)對象不包含以此為名的屬性,那么這個(gè)對象的原型將會被繼續(xù)檢查……
原文:
Object
ECMAScript does not contain proper classes such as those in C++, Smalltalk, or Java, but rather,supports constructors which create objects by executing code that allocates storage for the objects and initialises all or part of them by assigning initial values to their properties. All constructors are objects,but not all objects are constructors. Each constructor has a Prototype property that is used to implement prototype-based inheritance and shared properties. Objects are created by using constructors in new expressions; for example, new String("A String") creates a new String object. Invoking a constructor without using new has consequences that depend on the constructor. For example,String("A String") produces a primitive string, not an object.
ECMAScript supports prototype-based inheritance. Every constructor has an associated prototype, and every object created by that constructor has an implicit reference to the prototype (called the object's prototype) associated with its constructor. 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.

JavaScript技術(shù)Javascript 對象的解釋,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 亚洲一区二区三区视频免费观看 | 亚洲欧美第一视频 | 99久久国产综合精品麻豆 | 亚洲视频一区在线观看 | 夜夜精品浪潮av一区二区三区 | 欧美黑人一级爽快片淫片高清 | 国产香蕉视频在线播放 | 91精品久久久久久久久久入口 | 成年男女免费视频网站 | 成年人视频在线免费观看 | 欧美日韩视频网站 | 91影视| 日本超碰 | 91免费看片 | 干干干操操操 | 国产一级在线 | 欧美激情综合色综合啪啪五月 | av在线成人 | 欧美精品久久久久久久久老牛影院 | 亚洲视频欧美视频 | 亚洲一区网站 | 夜夜爆操 | 日韩欧美国产精品一区 | 一区二区在线不卡 | 欧美99久久精品乱码影视 | 欧美一区二区三区免费电影 | www日本高清视频 | 99久久免费精品国产免费高清 | 99热精品在线观看 | 欧美一区二区在线免费观看 | 美女逼网站 | 一级做a爰片性色毛片视频停止 | 日韩有码一区 | 91精品国产91久久久久久吃药 | 欧州一区二区三区 | 亚洲精品久久久久久久久久吃药 | 国产午夜精品久久 | 成人综合一区 | 中文字幕高清免费日韩视频在线 | 污污的网站在线观看 | 欧美淫片|