minor fixes
This commit is contained in:
parent
18a039473a
commit
ae8248bb56
1 changed files with 2 additions and 2 deletions
|
@ -73,9 +73,9 @@ alert("Hello")
|
|||
|
||||
The difference compared to the code above is only one character: the semicolon at the end of the first line is gone.
|
||||
|
||||
If we run this code, only the first `Hello` shows (and then you may see the error, but it may also be hidden). There are no numbers any more.
|
||||
If we run this code, only the first `Hello` shows (and there's an error, you may need to open the console to see it). There are no numbers any more.
|
||||
|
||||
That's because JavaScript does not assume a semicolon before square brackets `[...]`. So, the code in the last example is treated as a single statement.
|
||||
That's because JavaScript does not assume a semicolon before square brackets `[...]`. So, the code in the last example is treated as a single statement.
|
||||
|
||||
Here's how the engine sees it:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue