UV小Y
2015-12-04 23:53
<!DOCTYPE HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>数组</title>
<script type="text/javascript">
//创建数组
var mynum["*","##","***","&&","****","##"];
mynum[7]="**";
//显示数组长度
alert(mynum.length);
//将数组内容输出,完成达到的效果。
document.write(mynum[0]+<br/>+mynum[7]+<br/>+mynum[2]+<br/>+mynum[4]);
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>数组</title>
<script type="text/javascript">
//创建数组
var mynum=["*","##","***","&&","****","##"];
mynum[7]="**";
//显示数组长度
alert(mynum.length);
//将数组内容输出,完成达到的效果。
document.write(mynum[0]+'<br/>'+mynum[7]+'<br/>'+mynum[2]+'<br/>'+mynum[4]);
</script>
</head>
<body>
</body>
</html>
不需要用FOR来做吗?
JavaScript进阶篇
468194 学习 · 21891 问题
相似问题