From 4dc42722c914591300354296497dac7e6fad5a4f Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Thu, 9 May 2019 22:38:28 +0300 Subject: [PATCH] minor --- 1-js/04-object-basics/06-constructor-new/article.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/1-js/04-object-basics/06-constructor-new/article.md b/1-js/04-object-basics/06-constructor-new/article.md index eb452f2f..4a7922a7 100644 --- a/1-js/04-object-basics/06-constructor-new/article.md +++ b/1-js/04-object-basics/06-constructor-new/article.md @@ -83,7 +83,7 @@ let user = new function() { The constructor can't be called again, because it is not saved anywhere, just created and called. So this trick aims to encapsulate the code that constructs the single object, without future reuse. ```` -## Dual-syntax constructors: new.target +## Constructor mode test: new.target ```smart header="Advanced stuff" The syntax from this section is rarely used, skip it unless you want to know everything. @@ -109,7 +109,9 @@ new User(); // function User { ... } */!* ``` -That can be used to allow both `new` and regular calls to work the same. That is, create the same object: +That can be used inside the function to know whether it was called with `new`, "in constructor mode", or without it, "in regular mode". + +We can also make both `new` and regular calls to do the same, like this: ```js run function User(name) {