In this guide, we will discuss Map.remove() Function in Dart Programming Language. Removes key and its associated value, if present, from the map. The function also returns the value associated with the key.
Syntax
Map.remove(Object key)
Parameters
- Keys − identifies the entry to be deleted.
Return Type − Returns the value corresponding to the specified key.
Example
void main() { Map m = {'name':'Tom','Id':'E1001'}; print('Map :${m}'); dynamic res = m.remove('name'); print('Value popped from the Map :${res}'); }
It will produce the following output −
Map :{name: Tom, Id: E1001} Value popped from the Map :Tom
Next Topic : Click Here
Pingback: Dart Programming - Map.clear() Function | Adglob Infosystem Pvt Ltd
Pingback: Dart Programming - Map | Adglob Infosystem Pvt Ltd