Options
All
  • Public
  • Public/Protected
  • All
Menu

Module has

Index

References

Functions Object

References

Renames and re-exports has

Object Functions

  • has(object: any, path: ArrayPath): boolean
  • Checks if key is a direct property of object.

    since

    5.3.0

    see

    hasIn,hasPath,[[hasPathIn]]

    example
    const object = { 'a': { 'b': 2 } }
    const other = create({ 'a': create({ 'b': 2 }) })

    has(object, 'a')
    // => true

    has(other, 'a')
    // => false

    Parameters

    • object: any

      The object to query.

    • path: ArrayPath

      The key to check.

    Returns boolean

    Returns true if key exists, else false.