<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Math </title>
<script type="text/javascript">
document.write(Math.ceil(3.3)+
Math.ceil(-0.1)+Math.ceil(-9.9)+Math.ceil(8.9));
</script>
</head>
<body>
</body>
</html>
兄弟,你这结果输出来就是4啊。。 4+0-9+9.。。。
给其中一个加上中括号,破坏结构,防止运算
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Math </title>
<script type="text/javascript">
document.write([Math.ceil(3.3)]+
Math.ceil(-0.1)+Math.ceil(-9.9)+Math.ceil(8.9));
</script>
</head>
<body>
</body>
</html>