Wutou JavaScript learning notes

Source: Internet
Author: User

1. var life ={}; class definition.

In the process of assigning values to life. Age, define attributes, life. HanShu = function () {alert ('test')}: Define methods.

2. With (arguments. callee) {}, usage: indicates the execution object of the current event (similar to the usage in with and Delphi), that is, the object can be directly stored in () {You can call the method property of an object by writing its attributes and methods }.

Iii. types: NULL, undefined, bool, number, String, object, datetime.

4. categories are windows attributes. Methods and classes can be accessed by subscript like arrays. Just like the indexes in C #, strings can be used as subscripts to access the attributes or methods of objects (classes or methods.

5. This keyword of limit Crip is like a pointer. Specifically, it refers to who is usually very depressing.

6. Prototype. js can use prototype to make it have attributes and methods of the parent object. It is equivalent to inheritance in C #, but it is essentially a prototype chain, not a parent-child relationship in C. The prototype can also add attributes and methods to defined objects, including adding defined objects to the system (not recommended ).

7. Closure: Define the attributes, events, and methods of objects within the method (define anonymous methods in the method) to form a false class. Class in C.

8. JSON; defines the JSON data format, and VAR jsonclass = {SX1: "property 1", sx2: "Property 2", sx3 {sx11: "" property 1, sx12: "attribute 2"}, FF: function () {}, SZ: [Character 1, character 2]}

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.