objects are referred to as reference type values in JavaScript , and there are built-in reference types that can create specific objects:
-
- The reference type is similar to the class of the traditional object-oriented program design, but the implementation is different;
- object is an underlying type, and all other types inherit basic behavior from object.
- The array type is an ordered list of values and also provides the ability to manipulate and transform those values.
- The date type provides information about dates and times, including calculation functions related to information.
- The regexp type is an interface that ECMAScript supports regular expressions and provides the functionality of some regular expressions.
The function is actually an instance of the Fucntion type, so the function is also an object, and this is where JavaScript is most characteristic, because functions are objects, so functions have methods that can be used to enhance their behavior.
Because of the basic wrapper type , the basic type in JavaScript can also be accessed as an object class , with three basic wrapper types: Boolean, number, String:
-
- Each wrapper type is mapped to the base type with the same name ;
- When you access a base type in read mode , you create an object of the corresponding basic wrapper type , which facilitates data manipulation
- Once the statement that operates the base type value is executed , the newly created wrapper object is immediately destroyed .
Before the code executes , there are two built-in objects in scope : Global and math. In most ECMAScript implementations, there is no direct access to the Global object Web browser to implement the Window object that assumes this role. Global variables and functions are properties of the global object. The Math object provides many properties and methods.
JavaScript Advanced Programming--reference types