The original program code is interpreted.
Operators are separated by semicolons. At the same time, after a completed (i.e. complete) statement located on one line, the separator can be omitted: in this case, branching to another line works the same as a semicolon.
An inline comment (uninterpreted, ignored text) is marked with //, and a multiline comment is marked with a pair of / * and * /.
Weak (dynamic) typing is applied to the data. In operators with different types of data, the latter are automatically converted to the required type. Data types can be primitive and composite. Primitive types contain simple homogeneous values, such data can be passed to functions as parameters by value, rather than by reference. Composite types contain heterogeneous data (including composite ones), they are passed to functions only by reference.
I / O is mostly limited to interactions with documents and users. By default, it is assumed that access to the local file system is denied. However, browsers can provide special objects with the help of which it is possible to work with the user’s file system, albeit with the issuance of warnings about the danger of performing file operations.
In this case, the <SCRIPT> container will be located directly in the HTML document. The program code is written directly in an HTML document or in special text files that can be called from the main HTML document. Let’s start with the first option. First of all, the browser finds the <script> tag in the body of the web document, and tries to process all subsequent text as script code. And so on until it encounters the closing </script> tag. After that, all subsequent characters will be treated as HTML text. Any HTML document can contain multiple “script inclusions”, but each must open and end with a matching tag.