为啥我的数组长度是1啊?大神指教 谢谢
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>第三章习题-4</title>
</head>
<body>
<script>
function chengfa(want){
var show = new Array(want);
alert(show.length);
/*for(var i=1;i<show.length+1;i++)
{
show[i-1]=want*i;
document.write(want+"*"+i+" = "+show[i-1]+"<br>");
}*/
}
var Num;
while((Num=prompt("请输入数字",12))!=-1)
{
while(isNaN(Num)==true)
{
alert("请重新输入!");
var Num=prompt("请输入有效数字",12);
}
if(Num==-1)
{
break;
}
chengfa(Num);
}
</script>
</body>
</html>