浏览器中没有显示任何内容,并且由于 JavaScript 没有编译器来运行它,尽管我不确定如何检查这种语言的错误。
我的 HTML
<!doctype html>
<html>
<head>
<title>Where am I?></title>
<script src="script4.js"></script>
</head>
<body>
</body>
</html>
我的 script4.js
var number = 20;
switch(number) {
case number > 0:
alert(number + " is Positive");
break;
case number === 0:
alert(number + " is zero");
break;
case number < 0;
alert(number + " is negative");
default:
alert(number + " is not a number");
}