From 9b2ae09e4322283ed6078ef4b909f5d629b03033 Mon Sep 17 00:00:00 2001 From: HS <24558802+h-s04@users.noreply.github.com> Date: Mon, 29 Aug 2022 19:25:58 +0800 Subject: [PATCH] Add resources for JavaScript strict mode (#1623) * Update 110-javascript-strict-mode.md * Update content/roadmaps/106-javascript/content/110-javascript-strict-mode.md Co-authored-by: Kamran Ahmed --- .../content/110-javascript-strict-mode.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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