How to check if a value exists in a map with Dart

1 Answer

0 votes
void main() {
    var map = {'dart': 13, 'c': 96, 'c++': 10, 'python': 40, 'java': 50};
    
    var value = 96;
 
    if (map.containsValue(value) ) {
        print('yes');
    } else {
        print('no');
    }
}
   

   
   
/*
run:
   
yes
   
*/

 



answered Oct 11, 2022 by avibootz

Related questions

1 answer 145 views
1 answer 144 views
144 views asked Oct 11, 2022 by avibootz
1 answer 134 views
134 views asked Oct 11, 2022 by avibootz
2 answers 165 views
1 answer 184 views
1 answer 169 views
1 answer 174 views
...