JS: Object Overview

By Xah Lee. Date: . Last updated: .

What is JavaScript Object

A JavaScript Object is a collection of key-and-value pairs. e.g. {a:1, b:2}. Each key-and-value pair is called a Property.

Special Object and Data Object

JavaScript objects can be categorized into 2 kinds:

Prototype of an Object (Parent)

This is called Prototype-Based Object System.

IsExtensible

Each object has a special true/false value attached called the [[isExtensible]] internal slot. It specifies whether new properties can be added to the object.

Standard Object, Hosted Object, User-Created Object

It is useful to distinguish objects by where they came from. We have the following sources:

Standard Object

Objects from the JavaScript language. e.g. arrays, functions, dates, regex, etc.

Hosted Object

Objects from the hosting environment. e.g. in Browser, there's Browser's Window Object. In deno, there is deno object, with properties such as version etc.

User-defined Object (Data Object)

User defined.

JavaScript. Object and Inheritance