• It will return the desired value based on the provided property.

    Type Parameters

    • Value extends RecordT
    • Property extends string
    • Fallback extends any

    Parameters

    Returns Fallback | ValueAtT<Value, PathT<Property>>

    Since

    1.0.0

    Example

    get({ a: { b: [{ c: { d: 1 } }] } }, "a.b.0.c.d");
    // => 1

    Example

    get({ a: { b: [{ c: { d: 2 } }] } }, "a.b[0][c].d");
    // => 2

    Example

    get({ a: { b: [{ c: { d: 1 } }] } }, "a.b.0.c.e");
    // => undefined

    Example

    get({ a: { b: [{ c: { d: 1 } }] } }, "a.b.0.c.d", 3);
    // => 3