Skip to content

Instantly share code, notes, and snippets.

@epappas
Created June 19, 2014 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epappas/06ea45d87e0af47d060b to your computer and use it in GitHub Desktop.
Save epappas/06ea45d87e0af47d060b to your computer and use it in GitHub Desktop.
Traverse complex objects
function obj(o) {
var args = Array.prototype.slice.call(arguments, 1);
return (function __get(o, args) {
var key = args.shift();
if(key !== undefined) return __get(o[key] || { }, args);
return o;
})(o, args);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment