computer-scienceangular-roadmapbackend-roadmapblockchain-roadmapdba-roadmapdeveloper-roadmapdevops-roadmapfrontend-roadmapgo-roadmaphactoberfestjava-roadmapjavascript-roadmapnodejs-roadmappython-roadmapqa-roadmapreact-roadmaproadmapstudy-planvue-roadmapweb3-roadmap
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
1.3 KiB
13 lines
1.3 KiB
# Strict Mode |
|
|
|
JavaScript's strict mode is a way to opt-in to a restricted variant of JavaScript, thereby implicitly opting out of "sloppy mode". Strict mode isn't just a subset: it intentionally has different semantics from regular code. Browsers not supporting strict mode will run strict mode code with different behavior from browsers that do, so don't rely on strict mode without feature-testing for support for the relevant aspects of strict mode. Strict mode code and non-strict mode code can coexist so that scripts can opt into strict mode incrementally. |
|
|
|
Strict mode makes several changes to normal JavaScript semantics: |
|
|
|
- Eliminates some JavaScript silent errors by changing them to throw errors. |
|
- Fixes mistakes that make it difficult for JavaScript engines to perform optimizations: strict mode code can sometimes run faster than identical code that's not strict mode. |
|
- Prohibits some syntax likely to be defined in future versions of ECMAScript. |
|
|
|
<ResourceGroupTitle>Free Content</ResourceGroupTitle> |
|
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode'>Strict mode</BadgeLink> |
|
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://javascript.info/strict-mode'>Strict mode in JavaScript</BadgeLink>
|
|
|