问答详情
源自:7-13 向上取整ceil()

请问我这为啥运行没结果

<!DOCTYPE html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Math </title>

<script type="text/javascript">

function num(a)

{

    document.write(Math.ceil(a)+"<br>");

}

var myarr=[3.3,-0.1,-9.9,8.9];

for(var i=0;i++<myarr.length)

{

    num(myarr[i]);

}

</script>

</head>

<body>

</body>

</html>


提问者:带着乌龟追蜗牛 2017-03-01 09:41

个回答

  • 学习js
    2017-03-01 09:44:07
    已采纳

    for(var i=0;i++<myarr.length) for循环你写错了