Data types and naming conventions in JavaScript

Source: Internet
Author: User

There are 7 types of data:

undefined(Not defined)

null(empty),

boolean(Boolean type)

stringString

symbol(symbol),

numberDigital

objectObject

Naming rules

VariableThe name of (a variable) can be a number, a letter, $ or a _ composition, but not a space or a number headed.

Attention:

When a variable in JavaScript is declared, the inside of the program gives it an initial value undefined . When you perform an operation on a variable that is a value undefined , the result will be NaN , "not a number NaN ". When you use a non 定义 -variable to do a string connection operation, it will output truthfully "undefined" .

All variables in JavaScript are case-sensitive. This means that you have to treat the uppercase and lowercase letters differently.

"your name"is called a string . A string is a series of 0 or more characters wrapped in single or double quotation marks.

In JavaScript, you can \ escape quotation marks by using a backslash () in front of the quotation marks.

Data types and naming conventions in JavaScript

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.