JavaScript · Junior · Question 49 of 75

What does the 'use strict' directive give you?

Explanation

For example, assigning to an undeclared variable throws instead of creating a global, and this in a regular function is undefined, not window. Modules and classes run in strict mode automatically.

Further reading

Problem with a question

JavaScript · Junior · question 49

Test yourself

Take the JavaScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz