用for循环计算也可以吧?总觉得哪里不对,虽然得出数值了
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Math </title>
<script type="text/javascript">
var marry=[3.3,-0.1,-9.9,8.9];
for (var i = 0; i < marry.length; i++) {
document.write(Math.ceil(marry[i])+"<br/>");
}
</script>
</head>
<body>
</body>
</html>
//感觉还有更好的方法?