JS Basic syntax

Source: Internet
Author: User

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

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.