The 2nd chapter of HTML+CSS Review

Source: Internet
Author: User

1. Define arrays and objects in Java:

Array literal defines an array: [40, 100, 1, 5, 25, 10] object literal defines an object: {firstName: "John", LastName: "Doe", Age:50, Eyecolor: " Blue "}

2. Case-sensitive in Java, newline is "\ n", comments are "//", multiline comments start with/*, end with */, value = undefined (no variable with value declaration)

3. Data types: String (string), Number, Boolean (Boolean), arrays (array), objects (object), null (NULL), undefined (Undefined).

There are 5 different types of data in JavaScript:    string, Number    ,    Boolean, Object   ,    function3 type of object :   Object,    Date,    Array2 A data type that does not contain any values:    null,    undefined

4. Two ways to Access object properties: person.lastname;person["LastName"];

5. Lifetime of Java variables: The lifetime of JavaScript variables begins at the time they are declared. Local variables are deleted after the function is run. Global variables are deleted after the page is closed.

6. Global variables in HTML: In HTML, global variables are window objects: All data variables belong to the Window object. For example://Here you can use Window.carname

7. HTML events can be browser behavior or user behavior.

8. typeof Operator:

typeof "John"                //return stringtypeof 3.14                  //return numbertypeof false                 //return Booleantypeof [1,2,3,4]             //return to obj ECT

9. Date function

GetDate () Returns the day of the one month (1 ~ 31) from the Date object. GetDay () Returns the day of the week (0 ~ 6) from the Date object. getFullYear () returns the year as a four-digit number from a Date object. GetHours () returns the hour (0 ~ 23) of the Date object. Getmilliseconds () returns the milliseconds (0 ~ 999) of the Date object. Getminutes () returns the minute (0 ~ 59) of the Date object. GetMonth () returns the month (0 ~ 11) from the Date object. Getseconds () returns the number of seconds (0 ~ 59) of the Date object. GetTime () returns the number of milliseconds since January 1, 1970.

The 2nd chapter of HTML+CSS Review

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.