Eliminate entries from a map.
import public
|
The remove() method deletes an entry with a given key from the map. If a value is supplied, the entry will be removed only if its value matches the specified value.
Choose one of the following:
public |
public |
V denotes the data type of the values stored in the map.
Parameter |
Description |
key |
Necessary: The key of the entry to be eliminated. |
value |
Optional: The value associated with the entry to be removed. |
Returns: |
If a value is provided, it returns true if an entry was successfully deleted, and false otherwise. If no value is specified, it returns the value of the removed entry, or null if there’s no entry with the specified key. |