key if it exists, otherwise defaultValue.T getOrDefault(T)(string key, T defaultValue) const @safeSafe read-only lookup with default value.
Like tryGet, but returns a default value instead of null when the key is not found. This is convenient for reading optional configuration values.
key | The member key to look up. |
defaultValue | Value to return if key is not found. |
key if it exists, otherwise defaultValue.