You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/03-strict-mode/article.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
For a long time JavaScript was evolving without compatibility issues. New features were added to the language, but the old functionality did not change.
4
4
5
-
That had the benefit of never breaking the existing code. But the back side is that any mistake or an imperfect decision made by JavaScript creators got stuck in the language forever.
5
+
That had the benefit of never breaking the existing codes. But the downside was that any mistake or an imperfect decision made by JavaScript creators got stuck in the language forever.
6
6
7
-
It had been so before 2009 when ECMAScript 5 (ES5) appeared. It added new features to the language and modified some of the existing ones. To keep the old code working, most modifications are off by default. One needs to enable them explicitly with a special directive `"use strict"`.
7
+
It had been so until 2009 when ECMAScript 5 (ES5) appeared. It added new features to the language and modified some of the existing ones. To keep the old code working, most modifications are off by default. One needs to enable them explicitly with a special directive `"use strict"`.
8
8
9
9
10
10
[cut]
@@ -35,7 +35,7 @@ There is no strict mode here:
35
35
36
36
```js no-strict
37
37
alert("some code");
38
-
// "use strict" below is ignored, must be not on the top
38
+
// "use strict" below is ignored, must be on the top
39
39
40
40
"use strict";
41
41
@@ -60,11 +60,11 @@ It is recommended to always start a script with `"use strict"`, for the followin
60
60
1. First, all modern browsers support it. Only outdated ones like Internet Explorer 9 and below do not.
61
61
2. Second, the modern JavaScript actually forces us into the strict mode. There are several modern language features like "classes" and "modules" that enable strict mode automatically. So, it's hard to evade it.
62
62
63
-
Here in the tutorial all code (where not explicitly noted otherwise) works in `"use strict"`. We concentrate on modern JavaScript. But there will be notes about what happens without `"use strict"`, so that you can understand what's going on if you forget it or if you're working with an outdated script that doesn't have it.
63
+
Here in the tutorial, all code (where not explicitly noted otherwise) works in `"use strict"`. We concentrate on modern JavaScript. But there will be notes about what happens without `"use strict"`, so that you can understand what's going on if you forget it or if you're working with an outdated script that doesn't have it.
64
64
65
65
## Summary
66
66
67
-
- The `"use strict"` directive switches the engine to the "modern" mode, changing the behavior of some builtin features.
67
+
- The `"use strict"` directive switches the engine to the "modern" mode, changing the behavior of some built-in features.
68
68
- Several modern features of the language enable `"use strict"` implicitly, so it's quite hard to evade it.
69
69
70
70
It's always recommended to start scripts with `"use strict"`. All examples in this book assume so, unless (very rarely) specified otherwise.
0 commit comments