Skip to content

Instantly share code, notes, and snippets.

@alferov
Last active August 29, 2015 14:24
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 alferov/4043ece9c5a2fb21a5e1 to your computer and use it in GitHub Desktop.
Save alferov/4043ece9c5a2fb21a5e1 to your computer and use it in GitHub Desktop.
checkNested
function checkNested(obj) {
var args = Array.prototype.slice.call(arguments, 1);
for (var i = 0; i < args.length; i++) {
if (!obj || !obj.hasOwnProperty(args[i])) {
return false;
}
obj = obj[args[i]];
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment