Facebook Pixel

What is this in strict mode in JavaScript?

In a plain function call under strict mode, this is undefined instead of the global object. This prevents accidental pollution of the global object.

Verify This Answer

Cross-check this information using these trusted sources:

More FAQs in The this Keyword in JavaScript: The Basics

By how the function is called, not where it is defined. A plain call gives this as the global object (or undefined in strict mode). A method call gives the object. call, apply, and bind set this explicitly. new creates a fresh object as this.

call and apply invoke the function immediately with a specific this (call takes comma-separated args, apply takes an array). bind returns a new function with this permanently bound, to be called later.

Arrow functions do not have their own this. They inherit this from the enclosing lexical scope at definition time. call, apply, and bind cannot change an arrow's this.

Still have questions?

Browse all our FAQs or reach out to our support team

Want to upskill yourself?

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.