Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 49 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. function getProp(object, keys, defaultVal = null) {
  2.   keys = Array.isArray(keys) ? keys : keys.replace(/(\[(\d)\])/g, '.$2').split('.');
  3.   object = object[keys[0]];
  4.   if (object && keys.length > 1) {
  5.     return this.__get(object, keys.slice(1), defaultVal);
  6.   }
  7.   return object === undefined ? defaultVal : object;
  8. }
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