code: function hasProperty(value, prop) {
      return (value && typeof value === 'object' && prop in value) ||
          value !== null && value !== undefined && value[prop] !== undefined;
  }
docs: /////////////////////////////////////////////////////////////////////// Checks if the property exists in the object or value or its prototype;