Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

Object() constructor

2 tags 1 category

The Object() constructor turns the input into an object. Its behavior depends on the input’s type.

Return value: When the Object() constructor itself is called or constructed, its return value is an object:

Return value: If the value is null or undefined, it creates and returns an empty object. If the value is an object already, it returns the value. Otherwise, it returns an object of a type that corresponds to the given value. For example, passing a BigInt primitive returns a BigInt wrapper object.

Return value: When Object() is constructed but new.target is not the Object constructor itself, the behavior is slightly different — it initializes a new object with new.target.prototype as its prototype. Any argument value is ignored. This may happen, for example, when Object() is implicitly called via super() in the constructor of a class that extends Object. In this case, even if you pass a number to super(), the this value inside the constructor does not become a Number instance.

Syntax example: new Object()

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…