*гневно топчется в подписи*Я так старалась, шатала...и шо?! *Злое Рейн*
Мертвый в доме [17] to Толстый Енот: пфф, ты их Вырезано видел вообще? (Ред. ОМФ)
Прошу прощения за этот позор (c)
И снизу дно, и сверху дно, кругом темно... Ира, я хочу кефира!
JavaScript is a bit confusing for developers experienced in class-based languages (like Java or C++), as it is dynamic and does not provide a class implementation per se (the class keyword is introduced in ES6, but is syntactical sugar, JavaScript is remaining prototype-based).
When it comes to inheritance, JavaScript only has one construct: objects. Each object has an internal link to another object called its prototype. That prototype object has a prototype of its own, and so on until an object is reached with null as its prototype. null, by definition, has no prototype, and acts as the final link in this prototype chain.
While this is often considered to be one of JavaScript's weaknesses, the prototypal inheritance model is in fact more powerful than the classic model. It is, for example, fairly trivial to build a classic model on top of a prototypal model.
Inheritance with the prototype chain
Inheriting properties
JavaScript objects are dynamic "bags" of properties (referred to as own properties). JavaScript objects have a link to a prototype object. When trying to access a property of an object, the property will not only be sought on the object but on the prototype of the object, the prototype of the prototype, and so on until either a property with a matching name is found or the end of the prototype chain is reached.
удалено. форумка за необоснованную критику действий Ордена Стражей вне специального раздела