🔸new.target
in normal function calls, new.target is undefined
.
in class constructors (or function called using new), new.target refers to the constructor/function that was directly invoked by new. for example:
⚠️ class constructors cannot be invoked without 'new'.
new.target "pseudo-property" is available in all functions.
Last updated