@corefunc/corefunc
    Preparing search index...

    Function objectGetProperty

    • Type Parameters

      • ObjectType extends Record<string, any>
      • KeyType extends string | number | symbol
      • DefaultType

      Parameters

      • object: ObjectType

        Object to search in

      • keyOrPath: string | string[] | KeyType

        String key or array of string to form path

      • OptionaldefaultValue: DefaultType

        Default value if path is not exists. Does not replace undefined values

      • OptionalvalueType:
            | "string"
            | "number"
            | "boolean"
            | "symbol"
            | "undefined"
            | "object"
            | "function"
            | "map"
            | "null"
            | "error"
            | "asyncfunction"
            | "array"
            | "date"
            | "generatorfunction"
            | "promise"
            | "proxy"
            | "regexp"
            | "set"
            | "weakmap"
            | "weakset"

      Returns DefaultType | ObjectType[KeyType]

      Value in path or default value

      objectGetProperty

      Gets the value at path of object.

      0.0.47

      Use optional chaining instead

      const value = object?.property?.subProperty ?? "N/A";