Skip to content
Node.js Sounds Complicated? This Article Makes It Click

Edit It: Does omitting the new keyword cause the constructor's this keyword to reference the global object?

Home>new Operator in JavaScript>Edit It: Does omitting the new keyword cause the constructor's this keyword to reference the global object?

Edit It: Does omitting the new keyword cause the constructor's this keyword to reference the global object?

This code shows that omitting the new keyword makes a constructor's this keyword reference the global object.

See it on StackBlitz