Q32: What is Strict Mode ('use strict') and what changes does it enforce?
Strict Mode enforces cleaner JavaScript execution rules: 1) Prevents accidental global variable creation. 2) Throws errors on silent fails (read-only writes). 3) Disables with statements. 4) Sets default this in plain functions to undefined.
Key Takeaways
Opt-in via
'use strict';directive.Transforms silent runtime errors into explicit thrown exceptions.
Knowledge Check
What is the value of this inside a standard plain function call in Strict Mode?