From 24d5411a0e1ebe647af8f82186270b3232bc7aa7 Mon Sep 17 00:00:00 2001 From: paroche <46547072+paroche@users.noreply.github.com> Date: Sun, 6 Oct 2019 21:53:42 -0600 Subject: [PATCH] Update article.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and -> or, methods -> methods I also have a question on the subject of this sentence (should this be a separate discussion entry?): In the "Extending built-in classes" article, in the "No static inheritance in built-ins" subsection, one finds: "But built-in classes are an exception. They don’t inherit statics from each other. For example, both Array and Date inherit from Object, so their instances have methods from Object.prototype. But Array.[[Prototype]] does not reference Object, so there’s no Array.keys() and Date.keys() static methods." In the "Extending built-in classes" article, in the "No static inheritance in built-ins" subsection, one finds: "But built-in classes are an exception. They don’t inherit statics from each other. For example, both Array and Date inherit from Object, so their instances have methods from Object.prototype. But Array.[[Prototype]] does not reference Object, so there’s no Array.keys() and Date.keys() static methods." This is a subject of some curiosity for me. Through a little testing, I believe I have found that, in fact Array.[[Prototype]] DOES, however, reference Function.prototype, i.e. Array.__proto__ === Function.prototype (true). (As does Date.[[Prototype]]). Is there someplace where this is explained? (Preferably in a way an intelligent 11-year-old could understand?). --- 1-js/09-classes/05-extend-natives/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/09-classes/05-extend-natives/article.md b/1-js/09-classes/05-extend-natives/article.md index 88dda88e..9a568673 100644 --- a/1-js/09-classes/05-extend-natives/article.md +++ b/1-js/09-classes/05-extend-natives/article.md @@ -78,7 +78,7 @@ Normally, when one class extends another, both static and non-static methods are But built-in classes are an exception. They don't inherit statics from each other. -For example, both `Array` and `Date` inherit from `Object`, so their instances have methods from `Object.prototype`. But `Array.[[Prototype]]` does not reference `Object`, so there's no `Array.keys()` and `Date.keys()` static methods. +For example, both `Array` and `Date` inherit from `Object`, so their instances have methods from `Object.prototype`. But `Array.[[Prototype]]` does not reference `Object`, so there's no, for instance, `Array.keys()` (or `Date.keys()`) static method. Here's the picture structure for `Date` and `Object`: