Basic syntax
In JS, is case-sensitive
Identifier
The so-called identifiers are names of variables, arrays, functions, etc.
The naming of identifiers requires following a certain naming convention
Naming rules are divided into two categories: rigid requirements, soft requirements
The so-called rigid requirements, means that must be observed, if not complied with, even the program can not run
Soft requirements: Not required to comply with, but is an unwritten rule of the industry
Mandatory requirements Specific rules:
Consists of letters, numbers, underscores, and $, but cannot start with numbers
Disable the use of keywords and reserved words inside ES
Case sensitive
Soft requirements: hope to know the meaning of the text
You can tell what this identifier means by using an identifier name.
Naming laws:
Hump nomenclature: The Hump naming method is divided into two kinds: the big hump and the small hump. The so-called Big Hump (Pascal nomenclature) means that each word is capitalized, for example: UserName the so-called small hump, the first letter lowercase, and the first letter of the following words for example: UserName
Hungarian nomenclature:
The so-called Hungarian nomenclature is made up of one or more words, preceded by a fixed prefix
Array (arrays) A_myuser
Boolean (Boolean) b_ispassed
function (functions) fn_dosth
Object (objects) O_person
Snake Name method
The so-called serpentine nomenclature refers to the use of underscores to separate each word.
User_name User_password
JS Basic syntax