-
Notifications
You must be signed in to change notification settings - Fork 1
Function_evisit_core_js_utils_get
Wyatt Greenway edited this page Jan 31, 2017
·
4 revisions
- obj
- (Object) >>> Object to get property from
- path
- (String) Dot notation path to evaluate
- defaultValue [optional]
- (*) Specify a default value to return if the requested property is not found, is null, undefined, NaN or !isFinite
- (*) Return property specified by path
var obj = {hello: {world: "!!!"}, arr:[[1,2],3,4,5]}; utils.get(obj, 'hello.world'); //!!! utils.get(obj, "some.key.that.doesn't.exist", 'not found'); //not found utils.get(obj, "arr[0][0]"); //1 utils.get(obj, "arr[1]"); //3