Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* hello-world en version added 1st draft * moved description.en.yml file * deleted description file from git control * fixed hello-world en virsion * fixed grammar * fixed typos #1 * comments section en version #1 * comments section en version-hexlet-basics#2 * 40 instractions eng version * fixed vulnerability * 45 testing eng virsion 1 draft * fixing issues #1 * fixing issues after linting #1 * fixing issues after linting #2 * fixing typo * 45-testing added eng version * added eng version of description * 10-basics/50-syntax-errors fixing typo #1 * 10-basics/45-testing fixing typo * YAML is valid now * fixed typos * fixed typos * fixed YAML errors
- Loading branch information
1 parent
3e461d3
commit 04a6955
Showing
3 changed files
with
53 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
|
||
name: Syntax errors | ||
theory: | | ||
If a JavaScript program isn't syntactically correct, interpreter will show a relevant message and a note with a file and line where an error might have occured. **Syntax errors** occur when the code has grammar mistakes. Grammar rules are important in human languages but the lack of it won't affect your ability to read or understand any text. But in programming everything should be strict. Even a tiny violation and your program will not run. A wrong parenthesis order, a `;` that you forgot to add — these are just some examples of such violations. | ||
Here is an example of code with a syntax error: | ||
```javascript | ||
console.log('Hodor' | ||
``` | ||
If we run this code we will see the following message: `SyntaxError: missing ) after argument list`. In JavaScript such errors are called "SyntaxError". As we can see it includes a file path and a line number. | ||
On one hand, syntax errors are the simplest because they are all about code grammar rules and aren't related to any code logic. They can be easily fixed, you just need to find them. | ||
On the other hand, interpreter will not always tell you the correct position of an error. Sometimes you need to add a forgotten bracket to another place as opposed to what the error message says. | ||
instructions: | | ||
This task isn't related to the lesson directly but it would be useful to practice displaying content on the screen anyway. | ||
Display following text `What Is Dead May Never Die`. | ||
tips: | ||
- | | ||
[JavaScript errors](https://habr.com/ru/post/249525/) | ||
definitions: | ||
- name: "Syntax error" | ||
description: "violation of grammar rules in a programming language" | ||
- name: "SyntaxError (Parse error)" | ||
description: "type of errors in JavaScript, which occur when there are syntax errors in the code" |