findOrInsert Method
Obtains the value associated with the specified key, or inserts it if the specified key does not yet exist.
findOrInsert(key: K, value: V): { inserted: boolean, value: V }
@returns The found or inserted value and a flag indicating whether the new value was inserted.
Parameter | Type | Description |
---|---|---|
key | K | The key to search for. |
value | V | The value to associate with key if key does not yet exist in the dictionary. |
Returns - { inserted: boolean, value: V }
The found or inserted value and a flag indicating whether the new value was inserted.
Defined in
- core/bentley/src/Dictionary.ts Line 172
Last Updated: 23 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.