https://danmartensen.svbtle.com/the-anatomy-of-a-javascript-function#creating-function-instances_3Wie JavaScript-Funktion Objekte angelegt und erhalten ihre inneren Eigenschaften
Ich versuche, diesen Artikel auf zu verstehen, wie JavaScript-Funktion Objekte erstellt werden. Dort heißt es:
The new instance object is implicitly assigned many internal properties, one being the [[prototype]] property. The Function constructor’s prototype property referencing it’s prototype object is copied into this new object’s [[prototype]] property
Basing auf die obige Aussage i diesen Code schrieb:
function Person(){
}
console.dir(Function.prototype);
console.dir(Person.prototype);
nach der Aussage Function.prototype zu einer neu geschaffenen Funktion des Objekts prototpe zugeordnet (Person.prototype in diesem Fall). Ich habe beide gedruckt. Inhalt sieht anders aus.
Kann jemand erklären, wo mein Verständnis falsch ging. Durch die Art, wie ich auch auf ECMAScript-Spezifikationen sah, hat es die gleiche Aussage
JavaScript-Funktionen Nach Objekte sind. Selbst Ecmascript nennt das gleiche http://www.ecma-international.org/ecma-262/5.1/#sec-13.2 –
Ich möchte wissen, wie jede Funktion ihre internen Eigenschaften und Methoden wie Prototyp, Aufruf, Bindung usw. erhält. –