JavaScript Development Technology Daquan 4th Chapter Direct Quantity and Character Set _ basics

Source: Internet
Author: User
4.1 String Direct Quantity
1. String Direct Quantity
。 can be 0 or more.
。 The string must be written on the same line. Too long with + number
。 Used to define start and end double quotes and single quotes must match
2. Escape characters in a string
Escape character The character represented by
\' Single quotation mark
\" Double quotes
\\ Back slash
\b Backspace
\f Page breaks
\ n Line feed
\ r return character
\ t Horizontal tab
\v Vertical tab
\xxx Latin-1 characters specified by 2-bit hex (XX)
\xxx A latin-1 character specified by a 1-bit to 3-bit octal (1-377)
\uxxxx Unicode characters specified by 4-bit hexadecimal number (XXXX)
4.2 Number Direct Quantity
1. Integral type Direct quantity var a=10;
1. Decimal integer
28 integer first number must be 0,02,0123,047, note: ECMAScript does not support
36-in-process integers beginning with ox or 0x, OX123,OX12AF
2. Floating point Type Direct quantity
1. Traditional notation 12.345.2943 0.38
2. Scientific notation of 1.23e4=1.23x103=1230
4.3 Boolean Direct volume
4.4 Direct amount of array
var myarr=["My string", 123,];
4.5 Function Direct Quantity
function (argument list) {statement block in functions}
var myfunction=function (a,b) {return a+b};
4.6 Object Direct Quantity
{Property Name 1: Property value 1, property Name 2: Property value 2, property name 3, property value 3 ...}
var myobj={height:10,width:20,name: "Box"};
4.7 Special Direct Quantity
1.null Direct Quantity
var my=null;
2.undefined Direct Quantity
var mynumber=123;
Document.writer (MyNumber);
mynumber=undefined;
Document.writer (MyNumber);//equivalent to unassigned state
4.8 Character Set
JavaScript uses the Unicode character set
1.Unicode Character Set
For developers who are not in the English language, it is important to use the Unicode character set

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.