The new.target
pseudo-property lets you detect whether a function or constructor was called using the new operator. In constructors and functions invoked using the new operator, new.target
returns a reference to the constructor or function. In normal function calls, new.target
is undefined
.