An702343
2018-02-26 17:53
<!DOCTYPE HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>数组</title>
<script type="text/javascript">
//创建数组
var arr=new Array('*','##',"***","&&","****","##*");
var arr[7]="**";
//显示数组长度
alert(arr.length);
//将数组内容输出,完成达到的效果。
</script>
</head>
<body>
</body>
</html>
var arr[7]="**";
arr[7] = "**";
//创建数组
var arr=new Array('*','##',"***","&&","****","##*"); //这是有错误的
要么创建
var arr = new Array();
arr = ['*','##',"***","&&","****","##*"];
要么 直接赋值 var arr = ['*','##',"***","&&","****","##*"];
JavaScript进阶篇
468194 学习 · 21891 问题
相似问题