Options
All
  • Public
  • Public/Protected
  • All
Menu

Module object/has

Index

References

Functions

References

Renames and re-exports has

Functions

  • has<K>(s: K, obj: any): boolean
  • has<K>(s: K): (obj: any) => boolean
  • Returns whether or not an object has an own property with the specified name

    example
     var hasName = has('name');
    hasName({name: 'alice'}); //=> true
    hasName({name: 'bob'}); //=> true
    hasName({}); //=> false

    Type parameters

    • K: string | number | symbol

    Parameters

    • s: K
    • obj: any

      The object to query.

    Returns boolean

    Whether the property exists.

  • Returns whether or not an object has an own property with the specified name

    example
     var hasName = has('name');
    hasName({name: 'alice'}); //=> true
    hasName({name: 'bob'}); //=> true
    hasName({}); //=> false

    Type parameters

    • K: string | number | symbol

    Parameters

    • s: K

    Returns (obj: any) => boolean

    Whether the property exists.

      • (obj: any): boolean
      • Parameters

        • obj: any

        Returns boolean

Generated using TypeDoc