Skip to content

Commit 2a44419

Browse files
committed
fixes
1 parent b310b74 commit 2a44419

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

1-js/01-getting-started/3-devtools/article.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ Open Preferences and go to the "Advanced" pane. There's a checkbox at the bottom
5050

5151
Now `key:Cmd+Opt+C` can toggle the console. Also, note that the new top menu item named "Develop" has appeared. It has many commands and options.
5252

53+
## Multi-line input
54+
55+
Usually, when we put a line of code into the console, and then press `ley:Enter`, it executes.
56+
57+
To insert multiple line, press `key:Shift+Enter`.
58+
5359
## Summary
5460

5561
- Developer tools allow us to see errors, run commands, examine variables, and much more.

1-js/02-first-steps/03-strict-mode/article.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,24 @@ There is no directive like `"no use strict"` that reverts the engine to old beha
4747
Once we enter strict mode, there's no return.
4848
```
4949
50+
## Browser console
51+
52+
For the future, when you use a browser console to test features, please note that it doesn't `use strict` by default.
53+
54+
Sometimes, when `use strict` makes a difference, you'll get incorrect results.
55+
56+
Even if we press `key:Shift+Enter` to input multiple lines, and put `use strict` on top, it doesn't work. That's because of how the console executes the code internally.
57+
58+
The reliable way to ensure `use strict` would be to input the code into console like this:
59+
60+
```
61+
(function() {
62+
'use strict';
63+
64+
// ...your code...
65+
})()
66+
```
67+
5068
## Always "use strict"
5169
5270
We have yet to cover the differences between strict mode and the "default" mode.

1-js/11-async/08-async-iteration-generators/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ let range = {
4141
}
4242
};
4343

44-
for(let value in range) {
44+
for(let value of range) {
4545
alert(value); // 1 then 2, then 3, then 4, then 5
4646
}
4747
```

0 commit comments

Comments
 (0)