This commit is contained in:
Ilya Kantor 2019-06-07 09:29:16 +03:00
parent 6a4c4193ad
commit 3c37e1de7b
2 changed files with 13 additions and 5 deletions

View file

@ -53,9 +53,17 @@ For the future, when you use a browser console to test features, please note tha
Sometimes, when `use strict` makes a difference, you'll get incorrect results.
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.
You can try to press `key:Shift+Enter` to input multiple lines, and put `use strict` on top, like this:
The reliable way to ensure `use strict` would be to input the code into console like this:
```js
'use strict'; <Shift+Enter for a newline>
// ...your code
<Enter to run>
```
It works in most browsers, namely Firefox and Chrome.
If it doesn't, the most reliable way to ensure `use strict` would be to input the code into console like this:
```js
(function() {