Skip to content

Instantly share code, notes, and snippets.

@Havvy
Last active December 16, 2015 22:29
Show Gist options
  • Save Havvy/5506960 to your computer and use it in GitHub Desktop.
Save Havvy/5506960 to your computer and use it in GitHub Desktop.
var drill = function (object, path) {
for (var ix = 0; ix < path.length - 1; ix++) {
if (typeof object !== "object" || object === null) {
return undefined;
}
object = object[path[ix]];
}
return object[path][ix];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment