Javascript development technology Daquan Chapter 1 direct quantity and Character Set

Source: Internet
Author: User

4.1 string direct count
1. Direct string count
. It can be 0 or multiple.
. The string must be written in the same line. Too long + number
. Used to define that start and end double quotation marks and single quotation marks must match
2. escape characters in strings

Escape characters Characters
\' Single quotes
\" Double quotation marks
\\ Backslash
\ B Escape Character
\ F Page feed
\ N Line Break
\ R Carriage Return
\ T Horizontal Tab
\ V Vertical Tab
\ XXX Latin-1 characters specified by two-digit hexadecimal notation (xx)
\ XXX Latin-1 characters specified by octal sequence (1-377) from 1 to 3
\ UXXXX Unicode characters specified by 4-digit hexadecimal number (xxxx)
4.2 direct numeric count
1. The direct integer value var a = 10;
1. Decimal integer
The first number of the 2nd octal integer must be 0, 02, 0123,047. Note: ECMAScript does not support
A hexadecimal integer starting with ox or 0x, ox123, ox12AF
2. Floating Point Direct Volume
1. traditional LOG method 12.345. 2943 0.38
2. Scientific note 1.23e4 = 1.23x103 = 1230
4.3 Boolean direct quantity
4.4 direct array count
Var myarr = ["my string", 123,];
4.5 direct function quantity
Function (parameter list) {statement block in the function}
Var myFunction = Function (a, B) {return a + B };
4.6 direct object volume
{Attribute name 1: attribute value 1, attribute name 2: attribute value 2, attribute name 3, attribute value 3 .....}
Var myobj = {height: 10, width: 20, name: "box "};
4.7 Special direct traffic
1. null direct quantity
Var my = null;
2. undefined Direct Volume
Var mynumber = 123;
Document. writer (mynumber );
Mynumber = undefined;
Document. writer (mynumber); // equivalent to the unassigned status
4.8 Character Set
Javascript uses the Unicode Character Set.
1. Unicode Character Set
For developers who are not in English, using the Unicode Character Set is very important.

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.