You will definitely, like the rest of us, make mistakes in the code. Software bugs are called bugs. Bug - means an error in the program💾 or in the system, due to which the program produces unexpected behavior and, as a result, the result. Most software errors arise from errors made by program developers in its source code or in its design.
In the meaning of "elusive technical error", the word "bug" was used long before the advent of computers by the staff of telegraph and telephone companies in relation to problems with electrical equipment and radio equipment. In 1878, Thomas Edison wrote:
“This was the case with all my inventions. 1️⃣ The first step is intuition, which comes like a flash, then difficulties arise - the device refuses to work, and that's when the bugs appear - as these small mistakes and difficulties are called - and it takes months of close observation, research and effort before it comes to commercial success or failure. "
Debugging is the process of finding and fixing errors in a script.
The most common mistakes
A couple of the most common error types in code код:
Syntax Error - violation of language rules правил. For example, enter nine plus a semicolon
9 +; :
SyntaxError: Unexpected token;
Unexpected token; means that the interpreter has read something that it did not expect to read at all: in our case, a semicolon
Let's make a mistake again!
Let's enter five plus three in the console and a parenthesis at the end of
5 + 3).
You have a closing parenthesis
), but there is no opening parenthesis
(! But the parentheses always go in pairs - it cannot be that there is a closing, but there is no opening parenthesis, and vice versa.
ReferenceError is an invalid name! The
ReferenceError object represents an error that occurs when accessing a variable that does not exist. For example, enter five plus alternating
5 + alternating:
Now we have before us an error of the reference
ReferenceError. Perhaps you have already noticed what is the matter here? Let's read the error message carefully (after all, that's why it is displayed!). It says:
variable is not defined - the variable is not set, this is where our problem lies! First, we have to declare the variable-in some way, say this way:
A TypeError object represents an error that is thrown when a value is not of the expected type. We apply the
toUpperCase method, which we will learn more about later, to the undefined type, and this is not allowed since this method converts the string to uppercase. Check this error in the browser console, it doesn't work in
var foo = undefined
We can also make mistakes, so if you find an error on the site or incorrect translation, you can easily help fix the error on the site. To do this, click on the
Edit this page button at the very bottom of each page.
Write to Discord chat.
Syntax Error mean?
- Wrong order of signs
- Violation of the rules of the language
- Inappropriate parentheses
Reference Error mean?
- Undeclared variable
- Syntax error
- Wrong name
- MDN web docs
Thanks goes to these wonderful people (emoji key):
🐛 🎨 🖋