JavaScript Basic Concepts _ Basics

Source: Internet
Author: User
Tags reserved

One, case sensitive

Everything in ECMAScript (variables, function names, operators) is case-sensitive.

If the variable name test and test represent two different variables,

Second, identifiers

An identifier is the name of a variable, function, attribute, or the parameter of a function. An identifier is one or more characters grouped by the following formatting rules:

The first character must be a letter, an underscore (_), or a dollar sign ($);
Other characters can be letters, underscores, dollar signs, or numbers.
The ECMAScript identifier is in the Camel case format, which is the first letter lowercase, and the remainder of the first letter of the word is capitalized, for example: Firstsecond,mycar,dosomethingimport

Third, note

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

Single-line Comment: Starts with a two slash:
Single-line Comment
Block-level comments begin with a slash and an asterisk (/*), ending with an asterisk and a slash (* *) such as:
/*
* This is a multiline
* (Block level) Note
*/

Iv. statements

The statement in ECMAScript ends with a semicolon, and if the semicolon is omitted, the parser determines the end of the statement, such as:

var sum = a + b//Even without a semicolon is a valid statement-------not recommended

var diff = A-b; Valid statements---------recommended
Although the semicolon at the end is not required, it is recommended that you do not omit it at any time.

V. Keywords and reserved words

Keywords and reserved words: characters that have a specific purpose that can be used to indicate the beginning or end of a control statement, or to perform a specific operation, and so on.

Keywords and reserved words: cannot be an identifier or a property name.

The above is all about the basic concept of JavaScript, I hope you can enjoy it.

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.