insert Method

Attempts to insert a new entry into the dictionary. If an entry with an equivalent key exists, the dictionary is unmodified. If the new entry is in fact inserted, both the key and value will be cloned using the functions supplied to the dictionary's constructor.

insert(key: K, value: V): boolean

Parameter Type Description
key K The key to associate with the value
value V The value to associate with the key

Returns - boolean

true if the new entry was inserted, false if an entry with an equivalent key already exists.

Defined in

Last Updated: 30 November, 2023