Module gamejs/utils/objects
Utility functions for working with Objects
Functions
- accessor(object, name, get, set)
- accessors(object, props)
- extend(subClass, superClass)
- keys(obj)
- merge(obj...)
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 |
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. |
extend (subClass, superClass)
Put a prototype into the prototype chain of another prototype.
Parameters
| Object | subClass | |
| Object | superClass |
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 |