<!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>无标题文档</title>
<script>
// js定义数组
var as = new Array();
var bs = ['张三',0,'abc'];
as[0] = 'a';
as[1] = 100;
as[2] = true;
as[3] = null;
alert(as[2]);
alert(bs);
//js对象格式
var p = {name:"张三",age:25,addr:"河南郑州"};
alert(p.name);
</script>
</head>
<body>
</body>
</html>
JavaScript的数组简单引用实例
最新推荐文章于 2022-06-22 16:24:29 发布