diff --git a/content/roadmaps/106-javascript/content/110-javascript-strict-mode.md b/content/roadmaps/106-javascript/content/110-javascript-strict-mode.md index 9f7bf7485..d2595e02e 100644 --- a/content/roadmaps/106-javascript/content/110-javascript-strict-mode.md +++ b/content/roadmaps/106-javascript/content/110-javascript-strict-mode.md @@ -1 +1,13 @@ -# Javascript strict mode \ No newline at end of file +# 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. + +Free Content +Strict mode +Strict mode in JavaScript