- register (case) sensitive
- embedded in html, etc.
The core of the language is ECMAScript-262, where the main constructs and syntax are described.
Ctrl+L – clean up old code
Grouping operator: ( )
Arithmetic operators: +, -, *, /, % (integer remainder of division)
An operand is something with which operations are performed.
Binary operator: 5+5
Unary operator: +5
Important: a dot is used to write numbers with a comma – 5.1
String – any character set, text
‘ Cat’, “Cat” (you can use single or double quotes)
To display text on different lines, use the \n special character – transfer to a new line.
Example: “Hi, \ncat”
Tabulation is specified using the special character \t
Escaping characters, for example, we want to use double quotes inside double quotes, for example, “Cat has “Vera” kitten”, then you need to cover the inner quotes with a backslash \ – “Cat has \”Vera\” kitten”
If I want the backslash character itself to appear, then it also needs to be escaped: “Cat has \\Vera\\ kitten”, otherwise the interpreter will not show this slash, it will simply consider it an escape of some special character that is not actually here .
Example: “Cat \u2014 Vera” – we will see “Cat – Vera”
String concatenation (addition)
“cat” + ” ” + “Vera” (in this case, plus is the concatenation operator)