CKTIS / JavaScript
Object type — Object
Object is JavaScript’s non-primitive value type. Objects hold properties and have their own identity; assignment does not copy an object. Arrays and functions are objects too, whereas null is not an object.
Version: ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
Syntax
const item = { key: value };
item.key;
item["key"];
Object();The Object type includes JavaScript’s non-primitive values: ordinary objects, arrays, and functions. An object is a collection of properties whose keys are Strings or Symbols. A property can hold a value or use getter/setter accessor functions. The literal { count: 1 } creates an ordinary object, and item.count and item["count"] read the same property.
Objects have identity. Assigning const same = item does not copy properties: both variables refer to the same object. A change through same is therefore visible through item. The === operator compares objects by identity, not contents. Two separately created literals are different objects even when their properties are identical. const prevents reassignment of the variable but does not freeze the object.
Distinguish the Object type from the built-in Object function, which can also be used as a constructor. Object() and new Object() create an empty ordinary object; the literal {} is usually clearer. An object has a prototype that is another object or null; the prototype enables properties to be shared through inheritance.
typeof is not an exact test for the object type: typeof null returns "object" even though null is a primitive value, and typeof normally returns "function" for functions even though functions are objects. In browsers, document.all is a callable object, but its legacy [[IsHTMLDDA]] behavior makes typeof document.all return "undefined", not "function". Arrays also produce "object"; that result alone does not distinguish them from ordinary objects.
Examples
const item = { count: 1 };
const same = item;
same.count = 2;
console.log(item.count);
console.log(item === same);
console.log(item === { count: 2 });
console.log(typeof item);
console.log(typeof null);
console.log(typeof (() => {}));Result
2 true false object object function
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.