JavaScript objects locally, built-in objects and host objects

JS, an object may be divided into "inside the object", "host object" and "Custom Objects" three.

1, an internal object

Js internal object includes Array, Boolean, Date, Function, Global, Math, Number, Object, RegExp, String class object and various errors, including Error, EvalError, RangeError, ReferenceError, SyntaxError and TypeError.

Global and Math in which the two objects is also known as "built-in object", these two objects are created when the initialization script, these two do not have to instantiate objects.

 

 

2. host object

Host object is an object JS script execution environment provides. For the JS embedded in Web pages for which the host is the object that provided by the browser, it is also known browser object, the object such as IE, Firefox, etc. provided by the browser. Host object to provide a different browser may be different, even if the same object is provided, which is realized in very different ways! This will bring the browser compatibility problems, increase the difficulty of development.

There are many browser object, such as Window and Document, and so on.

 

3. Custom Objects

As the name suggests, it is the object of the developer's own definition. JS allows the use of custom objects, and the JS application functionality to be expanded

Guess you like

Origin www.cnblogs.com/plBlog/p/12002504.html