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 154 views
1 answer 163 views
163 views asked Oct 11, 2022 by avibootz
1 answer 152 views
152 views asked Oct 11, 2022 by avibootz
2 answers 185 views
1 answer 202 views
1 answer 184 views
1 answer 188 views
...