[2015-12-10 profile] see a little every day [Javascript.dom Programming Art (2nd edition)]

Source: Internet
Author: User

13:23~14:30 the 2nd Chapter

-------------------------------------------------------------------------------------------

1. Data type

Variable name: Alpha-Numeric $ _ (first not allowed to be a number)

Underline separate each word

Function name: Hump format named Mymode

-------------------------------------------------------------------------------------------

2. Declaring variables that do not require a type declaration: weak type

var a = ' don\ ' t ask '

var a = "don ' t ask"

var a =-3.22222 (any decimal place)

-------------------------------------------------------------------------------------------

3. Arrays

var AA = Array (4);

var AA = Array ();

Aa[0] = "John";

var AA = Array ("RR", "true");

var AA = ["RR", (), true];

var aa =array ();

var bb = [];

-------------------------------------------------------------------------------------------

4. Objects

var Lennon = Object ();

Lennon.name = "John";

var lennon = {na me: "John", year:1940, living:false};

-------------------------------------------------------------------------------------------

5. Compare

var a =false;
var B = "";
if (a = = b) {
Alert ("A is B");
}else{
Alert ("a isnot B");
}

= = Comparison Value

= = = Comparison Value and type

! = Comparison Value

!== comparison values and types

Logic && | | !

-------------------------------------------------------------------------------------------

6. Cycle

var count = 1;
while (Count <=11) {
alert (count);
count++;
}

bo=
alert (count);
count++;
}while (COUNT<11);

for (var count =1;count<11;count++) {
alert (count);
}

var AA = ["Ruj", [+], false];
for (var count =0;count<aa.length;count++) {
alert (count);
}

-------------------------------------------------------------------------------------------

7. Functions

var----local variables in a function

No var----global variables

-------------------------------------------------------------------------------------------

var jeremy = new Person; Jeremy has the properties and methods of person

Built-in objects: Array Date math and so on

var current_date = new Date ();

var today = Current_date.getday ();

Host objects: predefined objects provided by the browser: Document FORM element, etc.

[2015-12-10 profile] see a little every day [Javascript.dom Programming Art (2nd edition)]

Related Article

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.