Skip to content

safeLookup #33

@bishopZ

Description

@bishopZ

function _safeLookup(obj, pathString) {
var keys = pathString.split('.');
for (var i = 0; i < keys.length; i++) {
obj = obj[keys[i]];
if (obj === undefined) { return undefined; }
}
return obj;
}
from jashkenas/underscore#1889

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions