Module gamejs/utils/objects

Utility functions for working with Objects

Functions


accessor (object, name, get, set)

Create object accessors

Parameters

Object object The object on which to define the property
String name name of the property
Function get
Function set

See

https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/defineProperty

accessors (object, props)

Parameters

Object object The object on which to define or modify properties.
Object props An object whose own enumerable properties constitute descriptors for the properties to be defined or modified.

See

https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/defineProperties

extend (subClass, superClass)

Put a prototype into the prototype chain of another prototype.

Parameters

Object subClass
Object superClass

keys (obj)

fallback for Object.keys

Parameters

Object obj

Returns

Array list of own properties

See

https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/keys

merge (obj...)

Creates a new object as the as the keywise union of the provided objects. Whenever a key exists in a later object that already existed in an earlier object, the according value of the earlier object takes precedence.

Parameters

Object obj... The objects to merge