ObjectUtils
Utils that are related to common JavaScript objects.
Static Method Summary
Static Public Methods | ||
public static |
byKeyPath(obj: Object, path: string | Array<string>): * This method returns the value of an object at a given path. |
Static Public Methods
public static byKeyPath(obj: Object, path: string | Array<string>): * source
This method returns the value of an object at a given path. A key path is defined by a key within the object or alternatively a path through the object to a specific subkey. For example, ['a', 'b'] could be used to use 'key' as the key in the following object: { 'a': { 'b': 'key' } }
Params:
Name | Type | Attribute | Description |
obj | Object | The JS object to access. |
|
path | string | Array<string> | The key path to access. |
Return:
* | The value at the given path or undefined if the path does not exist. |