Object

js.lib.Object (extern class)

The js.lib.Object constructor creates an object wrapper.

Documentation Object by Mozilla Contributors, licensed under CC-BY-SA 2.5.

Static Members

prototype: ObjectPrototype

Allows the addition of properties to all objects of type Object.


assign(target: assign.T, sources: haxe.extern.Rest): assign.T

Copies the values of all enumerable own properties from one or more source objects to a target object.

Name Type
target assign.T
sources haxe.extern.Rest
Returns
assign.T

create(proto: AnonStruct, ?propertiesObject: haxe.DynamicAccess<ObjectPropertyDescriptor>): create.T

Creates a new object with the specified prototype object and properties.

Name Type Default
proto AnonStruct
propertiesObject haxe.DynamicAccess<ObjectPropertyDescriptor> (optional)
Returns
create.T

defineProperties(obj: defineProperties.T, props: haxe.DynamicAccess<ObjectPropertyDescriptor>): defineProperties.T

Adds the named properties described by the given descriptors to an object.

Name Type
obj defineProperties.T
props haxe.DynamicAccess<ObjectPropertyDescriptor>
Returns
defineProperties.T

defineProperty(obj: defineProperty.T, prop: String, descriptor: ObjectPropertyDescriptor): defineProperty.T

Adds the named property described by a given descriptor to an object.

Name Type
obj defineProperty.T
prop String
descriptor ObjectPropertyDescriptor
Returns
defineProperty.T

entries(obj: AnonStruct): Array<ObjectEntry>

Returns an array containing all of the [key, value] pairs of a given object's own enumerable string properties.

Name Type
obj AnonStruct
Returns
Array<ObjectEntry>

freeze(obj: freeze.T): freeze.T

Freezes an object: other code can't delete or change any properties.

Name Type
obj freeze.T
Returns
freeze.T

fromEntries(iterable: Any): fromEntries.T

Returns a new object from an iterable of key-value pairs (reverses Object.entries).

Name Type
iterable Any
Returns
fromEntries.T

getOwnPropertyDescriptor(obj: AnonStruct, prop: String): Null<ObjectPropertyDescriptor>

Returns a property descriptor for a named property on an object.

Name Type
obj AnonStruct
prop String
Returns
Null<ObjectPropertyDescriptor>

getOwnPropertyNames(obj: AnonStruct): Array<String>

Returns an array containing the names of all of the given object's own enumerable and non-enumerable properties.

Name Type
obj AnonStruct
Returns
Array<String>

getOwnPropertySymbols(obj: AnonStruct): Array<Symbol>

Returns an array of all symbol properties found directly upon a given object.

Name Type
obj AnonStruct
Returns
Array<Symbol>

getPrototypeOf(obj: AnonStruct): Null<getPrototypeOf.TProto>

Returns the prototype of the specified object.

Name Type
obj AnonStruct
Returns
Null<getPrototypeOf.TProto>

is(value1: is.T, value2: is.T): Bool

Compares if two values are the same value. Equates all NaN values (which differs from both Abstract Equality Comparison and Strict Equality Comparison).

Name Type
value1 is.T
value2 is.T
Returns
Bool

isExtensible(obj: AnonStruct): Bool

Determines if extending of an object is allowed.

Name Type
obj AnonStruct
Returns
Bool

isFrozen(obj: AnonStruct): Bool

Determines if an object was frozen.

Name Type
obj AnonStruct
Returns
Bool

isSealed(obj: AnonStruct): Bool

Determines if an object is sealed.

Name Type
obj AnonStruct
Returns
Bool

keys(obj: AnonStruct): Array<String>

Returns an array containing the names of all of the given object's own enumerable string properties.

Name Type
obj AnonStruct
Returns
Array<String>

preventExtensions(obj: preventExtensions.T): preventExtensions.T

Prevents any extensions of an object.

Name Type
obj preventExtensions.T
Returns
preventExtensions.T

seal(obj: seal.T): seal.T

Prevents other code from deleting properties of an object.

Name Type
obj seal.T
Returns
seal.T

setPrototypeOf(obj: setPrototypeOf.T, prototype: Null<AnonStruct>): setPrototypeOf.T

Sets the prototype (i.e., the internal Prototype property).

Name Type
obj setPrototypeOf.T
prototype Null
Returns
setPrototypeOf.T

values(obj: AnonStruct): Array<Any>

Returns an array containing the values that correspond to all of a given object's own enumerable string properties.

Name Type
obj AnonStruct
Returns
Array<Any>

Instance Members

new(?value: Any): Void

The Object constructor creates an object wrapper.

Name Type Default
value Any (optional)