Previous words
In programming languages, the types of values that can be represented and manipulated are called data types, and the most basic feature of a programming language is the ability to support multiple data types. JavaScript has a powerful type system that mainly includes native objects, host objects, and browser outreach objects, and this article mainly introduces 15 native object type systems
Native objects (15 kinds)
Native objects are divided into two categories: primitive type (primitive type) and object type. The primitive types are divided into two categories, one is null, the other is the wrapper object, and the object type can be divided into two categories: one is the constructor object, the other is the monomer built-in object
Null value (2 kinds)
Unlike other languages, JavaScript means that there are two values for null values, undefined and null, respectively. Logically, undefined represents a null value of the original type, and NULL represents the null value of the object type
Packaging Objects (3 types)
string strings, number numbers, Boolean booleans, although they belong to the original type. However, because of the nature of the wrapper object, you can call properties and methods
Constructor Object (9 types)
Ordinary objects are unordered collections of named values, but with different constructors, JavaScript defines multiple objects of varying functionality, including object objects, function functions, date dates, array arrays, error errors, regular regexp
[note] If you explicitly use the new constructor function to define the wrapper object, the string, number, and Boolean values are also part of the constructor object
Monomer built-in objects (4 types)
The single built-in objects include math, JSON, global objects, and arguments. Four. They do not need to be declared or constructed using a constructor, they can be used directly in the corresponding scenario
The following is a detailed description of the categories of objects
JavaScript type system--undefined and NULL
JavaScript type system--number number type
JavaScript type system--string String type
JavaScript type System--boolean Boolean type
JavaScript type System--object Object type
JavaScript type system--function function type
JavaScript type System--array array type
JavaScript type system--regexp regular type
JavaScript type system--date Date Time type
JavaScript type system--error error type
JavaScript type System--math Object
JavaScript type System--json Object
Overview of 15 native object type systems in JavaScript