Skip to content
🧠 Master React Package Creation — Claim Your Spot

Edit It: Use new.target to confirm if the new operator invoked the constructor

Home>new Operator in JavaScript>Edit It: Use new.target to confirm if the new operator invoked the constructor

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 StackBlitz