Retrieves a value from an object using a given path.

  • Parameters

    • object: any

      The object from which to retrieve the value.

    • path: any

      The path to the desired value, either as an array or dot-separated string.

    Returns any

    • The value at the specified path, or undefined if it does not exist.