請問函數名為 ath 為什么函數里輸入math也有輸出呢
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Math </title>
<script type="text/javascript">
function ath(x){
? ? document.write(Math.ceil(x)+"<br />");
? ? }
? ??
? ? ath(3.3);
? ? math(3.3);
</script>
</head>
<body>
</body>
</html>
2016-09-22
按照你定義的函數,其輸出應該是這樣的:
2016-09-18
math(3.3)沒有輸出,ath函數輸出的是Math.ceil(x)的值。Math是一個對象,提供對數據的數學計算,ceil是Math對象的一個方法,即向上取整。
2016-09-18
ath是自定義的函數,有一行輸出。
但是math(3.3)應該沒有輸出,因為解釋器不認識