getOrDefault method
V
getOrDefault(
- K key,
- V defaultValue
Returns the value for key, or defaultValue if the key is absent.
{'a': 1}.getOrDefault('b', 0) // 0
Implementation
V getOrDefault(K key, V defaultValue) => this[key] ?? defaultValue;