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 150 views
1 answer 156 views
156 views asked Oct 11, 2022 by avibootz
1 answer 144 views
144 views asked Oct 11, 2022 by avibootz
2 answers 177 views
1 answer 197 views
1 answer 178 views
1 answer 181 views
...