SHARE
TWEET

Untitled

a guest Apr 18th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. main() {
  2.  
  3.   // one way of adding elements
  4.   Map has = new Map();
  5.   has['key1'] = '1';
  6.   has['key3'] = 23;
  7.  
  8.   print(has);
  9.  
  10.   //another way of adding elements
  11.   Map m = {'1': 1, '2':2};
  12.   print(m);
  13.  
  14.   //printing using for each
  15.   m.forEach((key, value) => print('$key and $value'));
  16.  
  17.   //removing elements
  18.   m.remove('2');
  19.   print(m);
  20.  
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top