# Function hasOwn

- hasOwn(obj: any, key: string | number | symbol): boolean

  Checks whether the given object has the specified property as its own (not inherited).

  This is a safe version of `hasOwnProperty` that avoids issues with objects that have it overridden or missing from their prototype chain.

  #### Parameters

  - obj: any

    The object to check.

  - key: string | number | symbol

    The property key to look for.

  #### Returns boolean

  True if the object has the property as its own; otherwise, false.

  #### Example

      hasOwn({ foo: 123 }, 'foo'); // true
      hasOwn({}, 'bar'); // false

  - Defined in src/shared/utils.js:1210