In this guide, we will discuss Map.clear() Function in Dart Programming Language. Removes all pairs from the map.
Syntax
Map.clear()
Return Type − void
Example
void main() { Map m = {'name':'Tom','Id':'E1001'}; print('Map :${m}'); m.clear(); print('Map after invoking clear() :${m}'); }
It will produce the following output −
Map :{name: Tom, Id: E1001} Map after invoking clear() :{}
Next Topic : Click Here
Pingback: Dart Programming - Map.addAll() Function | Adglob Infosystem Pvt Ltd
Pingback: Dart Programming - Map | Adglob Infosystem Pvt Ltd