The basic concept --- part1

The core of any language are necessarily describe the basic working principle of this language, which is usually what is described to be involved in all of the language syntax , operators , data types , etc., js mother language is ECMAScript, which borrowed many c language, and other C-like languages (java) grammatical structure, so if there is to learn programming basics before js should be relatively easy to use, Let me introduce a few important points:

Case sensitive

All the js are case-sensitive, which means that a and A are two completely different variables

Identifier

Parameter identifier refers to the variable, function name, name of the property, or function of these identifiers naming ...... there is a certain specification of:
A. the first character must be a letter, underscore or the dollar sign ($)
B. in addition to the character other than the first character can be a letter, underscore, dollar sign or a digital
naming identifiers about three:
A. small hump: xiaoTuoFeng
B. big hump: DaTuoFeng
C. underline name: xia_hua_xian
course, this is naming conventions within the industry, not to say do not do it in accordance with this specification

Comment way

Any one language should have comments, which refers to the code snippets interspersed but not in force or text descriptions between code fragment, written comments is a good habit, it helps us and other small partners to understanding and cooperation of our code to improve the readability of our code, js syntax is a single-line comment "//" double slash

That I was not visible fragments do not enter into force. So if we are to Note 10 lines of code do? Certainly can not engage in double-slash line by line, the method can only be used batch annotated method is batch comment "/ * is annotated contents * /"

Statement

ECMAScript statements can be terminated with a semicolon, but can also omit the semicolon, if not determined statement ends with a semicolon at the end by the parser

Recommended not to omit the semicolon at any time, develop a good habit for yourself

Guess you like

Origin blog.csdn.net/weixin_34346099/article/details/91398886