我想翻译一些单词,但是当我用大写或混合写 HOUSE 时遇到问题。当我用小写字母书写时它才起作用
<script>
var translate = prompt("Enter one of the next words:\nhouse\ntable\ndog\ncat");
switch (translate){
case 'house': document.write("casa");
break;
case 'table': document.write("mesa");
break
case 'dog': document.write("perro");
break;
case 'cat': document.write("gato");
break;
default: document.write("Error");
}
</script>