I got this error Case expressions must be constant When I try to use value of the map in switch case
Don't know how to fix it
const map = {'cat': 10, 'dog': 7, 'mouse': 4};
function(animal) {
switch(animal){
case map['cat'] {
print('ok');
}
case map['dog']{
print('not ok');
}
}
}