Edit It: Use new.target to confirm if the new operator invoked the constructor
This code shows how to use new.target to confirm if the new operator invoked a constructor.
See it on StackBlitzThis code shows how to use new.target to confirm if the new operator invoked a constructor.
See it on StackBlitz