From 4df1cb9bbd02dd16410f811edc3037dd55870da1 Mon Sep 17 00:00:00 2001 From: Mustafa Kemal Tuna <12192118+lumosmind@users.noreply.github.com> Date: Tue, 5 Nov 2019 14:48:31 +0300 Subject: [PATCH] not proved features of class properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "The property name is not placed into User.prototype. Instead, it is created by new before calling the constructor, it’s a property of the object itself." you are talking about some features of "class properties" but the example code doesn't show these features. I changed the example code to show that defining property out of the constructor method is different from defining method in class structure. --- 1-js/09-classes/01-class/article.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/1-js/09-classes/01-class/article.md b/1-js/09-classes/01-class/article.md index 4aaf52bd..3f15760b 100644 --- a/1-js/09-classes/01-class/article.md +++ b/1-js/09-classes/01-class/article.md @@ -318,6 +318,9 @@ class User { } new User().sayHi(); + +alert(User.prototype.sayHi); // placed in User.prototype +alert(User.prototype.name); // undefined, not placed in User.prototype ``` The property `name` is not placed into `User.prototype`. Instead, it is created by `new` before calling the constructor, it's a property of the object itself.