Function defaultsDeep

  • This method is like defaults except that it recursively assigns default properties.

    Note: This method mutates object.

    Parameters

    • object: any

      The destination object.

    • Rest ...args: any[]
      Rest

    Returns any

    Returns object.

    Since

    5.21.0

    See

    [[defaults]]

    Example

    defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } })
    // => { 'a': { 'b': 2, 'c': 3 } }