Dart Programming – Map.remove() Function

  • Post author:
  • Post category:Dart
  • Post comments:2 Comments
Dart Programming map.remove() Function

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

This Post Has 2 Comments

Leave a Reply