code: function getIfHas(obj, prop) {
      const result = {valid: true};
      if (prop.indexOf('.') === -1) {
          result.has = prop in obj;
          result.target = obj;
          if (result.has) {
              result.value = obj[prop];
          }
      } else {
          const names = prop.split('.');
          let missing, target;
          for (let i = 0; i < names.length; i++) {
              const n = names[i];
              if (!n) {
                  result.valid = false;
                  return result;
              }
              if (!missing && hasProperty(obj, n)) {
                  target = obj;
                  obj = obj[n];
              } else {
                  missing = true;
              }
          }
          result.has = !missing;
          if (result.has) {
              result.target = target;
              result.value = obj;
          }
      }
      return result;
  }
docs: /////////////////////////////////////////////////////////////// Parses a property name, and gets its name from the object, if the property exists. Returns object {valid, has, target, value}: - valid - true/false, whether the syntax is valid - has - a flag that property exists; set when 'valid' = true - target - the target object that contains the property; set when 'has' = true - value - the value; set when 'has' = true