A review of 15 native object type systems in JavaScript

Source: Internet
Author: User
Tags object object wrapper

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

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.