Function hasIn

  • Checks if path is a direct or inherited property of object.

    Parameters

    • object: any

      The object to query.

    • key: PropertyName

      The key to check.

    Returns boolean

    Returns true if key exists, else false.

    4.0.0

    has, hasPath, hasPathIn

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

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

    hasIn(object, 'b')
    // => false