JS Main knowledge Contour Note

Source: Internet
Author: User

The underlying type and reference type in JS:

Base type:
1. Number
2, String
3, Boolean
4, Undefined
5, Null

Reference type (built-in object):
1. Type of Object
2. Array type
3. Date type
4, REGEXP type (literal notation:/[bc]at/i constructor method: New RegExp ("[Bc]at", "I") flags are: g/i/m instance method: Exec ("string to validate") match on the return of an array, matching does not return null)
5. Function type (internal properties: this, arguments; Function properties: length, prototype; Function method: Call (), apply ())
6. Basic Package Type (Boolean type, number type, String type)
7. Single built-in object (Global, Math)

(Note: Creating a reference type instance tends to have both a constructor method and a literal notation)


Second, BOM
Directory:
1. Window object
2. Location Object
3. Navigator Object
4. Screen Object
5. History Object

1. Window object
Dual role: JS accesses an interface and global object of the browser's window, and the variables and functions declared in the global scope become properties and methods of Window objects. The page is related to the <frameset>/<frame> of frames, each frame corresponds to a window (see JS Advanced programming)
browser window's location: Window.screenleft


Third, DOM

The This in JS
Global environment: this;//refers to the Window object;
Function call: foo (); This refers also to the Window object;
When called as an object method: Test.foo (); This points to the object itself test
When you use the call or Apply method on Function.prototype, the This in the function is explicitly set to the first argument of the function invocation.
In the constructor, this points to the newly created object itself.

JS Main knowledge Contour Note

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.