SHARE
TWEET

Untitled

a guest May 14th, 2019 135 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function checkNested(obj /*, level1, level2, ... levelN*/) {
  2.   var args = Array.prototype.slice.call(arguments, 1);
  3.  
  4.   for (var i = 0; i < args.length; i++) {
  5.     if (!obj || !obj.hasOwnProperty(args[i])) {
  6.       return false;
  7.     }
  8.     obj = obj[args[i]];
  9.   }
  10.   return true;
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top