Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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