From 8f3831be1ccd4ee146ba581ab57ff5ce5a68d130 Mon Sep 17 00:00:00 2001 From: Mustafa Kemal Tuna <12192118+lumosmind@users.noreply.github.com> Date: Thu, 23 Jul 2020 13:51:13 +0300 Subject: [PATCH] One line of code creates a lot of confusing "// obj.toString === obj.__proto__.toString == Object.prototype.toString" It is look like JS code but it gives different result from what we want to get. There is different kind of equality operator ant these give more confusing what is the purpose of these? It can be better to separate this line into 2 line of code to make it sensible and readable. Subject and code is already hard but there is no need to make readers ask unnecessary questions. --- 1-js/08-prototypes/03-native-prototypes/article.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/1-js/08-prototypes/03-native-prototypes/article.md b/1-js/08-prototypes/03-native-prototypes/article.md index 378936c9..6cf7aebb 100644 --- a/1-js/08-prototypes/03-native-prototypes/article.md +++ b/1-js/08-prototypes/03-native-prototypes/article.md @@ -33,7 +33,9 @@ We can check it like this: let obj = {}; alert(obj.__proto__ === Object.prototype); // true -// obj.toString === obj.__proto__.toString == Object.prototype.toString + +alert(obj.toString === obj.__proto__.toString); //true +alert(obj.toString === Object.prototype.toString); //true ``` Please note that there is no more `[[Prototype]]` in the chain above `Object.prototype`: