public get<R>(key as K, defaultValue as R) as R:
Returns the associated value or a typed default when the key is absent.
| Parameter | Description |
|---|---|
key | The key to search for. |
defaultValue | The value returned for an absent key. |
The stored value cast to R, or defaultValue.
values = t:{"answer": 42}
assert values.get("missing", 0) == 0