Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Write a Dart function that takes a map and returns a list of the map's keys. */
- void main() {
- Map<String,int> mapper = {'apple':1,'banana':2,'orange':3};
- print(mapKeys(mapper));
- }
- List<String> mapKeys(mapper)
- {
- List<String> abc =[];
- for(MapEntry <String,int> e in mapper.entries)
- {
- abc.add(e.key);
- }
- return abc;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement