Basic concepts of JavaScript and basic concepts of javascript

Source: Internet
Author: User

Basic concepts of JavaScript and basic concepts of javascript

I. Case Sensitive

All variables, function names, and operators in ECMAScript are case sensitive.

For example, the variables test and Test indicate two different variables respectively,

Ii. identifier

The identifier refers to the name of a variable, function, attribute, or function parameter. One or more characters of the identifier in combination according to the following format rules:

The first character must be a letter, underscore (_), or dollar sign ($ );
Other characters can be letters, underscores, dollar signs, or numbers.
ECMAScript identifiers are in the upper and lower case format, that is, the first letter is in lower case, and the first letter of each remaining word is in upper case, for example: firstSecond, myCar, doSomethingImport

3. Notes

ECMAScript uses C-style annotations, including single-line and block-level annotations.

Single line Note: It starts with two slashes, for example:
// Single line comment
A block-level annotation starts with a slash and an asterisk (/*). It ends with an asterisk and a slash (*/), for example:
/*
* This is a multiline
* (Block-level) Annotation
*/

Iv. Statements

The statement in ECMAScript ends with a semicolon. If the semicolon is omitted, it is determined by the parser that the statement ends, for example:

Var sum = a + B // a valid statement even if there is no semicolon ------- not recommended

Var diff = a-B; // valid statement --------- recommended
Although the semicolon at the end is not required, we recommend that you do not omit it at any time.

5. keywords and reserved words

Keywords and reserved words: characters with specific purposes. These keywords can be used to indicate the start or end of a control statement or to execute a specific operation.

Keywords and reserved words: they cannot be used as identifiers or attribute names.

The above is all about the basic concepts of javascript. I hope you will like it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.