Home  >  Article  >  Web Front-end  >  What are JavaScript built-in objects

What are JavaScript built-in objects

藏色散人
藏色散人Original
2022-01-18 15:01:183321browse

JavaScript built-in objects mainly refer to some global value properties, functions defined by js that exist in the global scope before the program is executed, and constructor objects used to instantiate other objects.

What are JavaScript built-in objects

The operating environment of this article: windows7 system, javascript version 1.8.5, Dell G3 computer.

What are JavaScript built-in objects?

js built-in objects:

The built-in objects in js mainly refer to some global objects defined by js that exist in the global scope before the program is executed. Value properties, functions, and constructor objects used to instantiate other objects. Generally, we often use global variable values ​​​​NaN and undefined, global functions such as parseInt(), parseFloat(), constructors used to instantiate objects such as Date, Object, etc., and single built-in objects that provide mathematical calculations such as Math. object.

Involving knowledge points:

Global objects (global objects) or standard built-in objects should not be confused with "global objects". The global objects mentioned here refer to objects in the

global scope. Other objects in the global scope can be created by user scripts or provided by the host program.

Classification of standard built-in objects

(1) Value attributes, these global attributes return a simple value, these values ​​have no properties and methods of their own.

For example, Infinity, NaN, undefined, null literals

(2) Function attributes, global functions can be called directly, there is no need to specify the owning object when calling, and the result will be directly Returned to the caller.

For example, eval(), parseFloat(), parseInt(), etc.

(3) Basic objects. Basic objects are the basis for defining or using other objects. Basic objects include general objects, function objects and error objects.

For example, Object, Function, Boolean, Symbol, Error, etc.

(4) Number and date objects, used to represent numbers, dates and objects that perform mathematical calculations.

For example, Number, Math, Date

(5) String, an object used to represent and operate strings.

For example, String, RegExp

(6) Indexable collection objects, these objects represent data collections sorted according to index values, including arrays and type arrays, and objects with array-like structures. For example, Array

(7) uses keyed collection objects. These collection objects use keys when storing data and support iterating elements in the order of insertion.

For example, Map, Set, WeakMap, WeakSet

(8) Vector collection, the data in the SIMD vector collection will be organized into a data sequence.

For example, SIMD, etc.

(9) Structured data, these objects are used to represent and operate structured buffer data, or data encoded using JSON.

For example, JSON, etc.

(10) Control abstract objects

For example, Promise, Generator, etc.

(11) Reflection

For example, Reflect , Proxy

(12) Internationalization, ECMAScript objects are added to support multi-language processing.

For example, Intl, Intl.Collator, etc.

(13)WebAssembly

(14)Others

For example, arguments

Recommended learning: "JS Basic Tutorial"

The above is the detailed content of What are JavaScript built-in objects. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn