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 set of the map's values. */
- void main() {
- Map<String,int> mapper ={'apple':1,'banana':2,'orange':3};
- print(maptokeys(mapper));
- }
- Set <int> maptokeys(mapper)
- {
- Set<int> abc ={};
- for(MapEntry<String,int> e in mapper.entries)
- {
- abc.add(e.value);
- }
- return abc;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement