<!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=gb2312" />
<title>无标题文档</title>
<script language="javascript">
/*
var names=["宋江","史进","花荣","李逵"];
var otherNames=new Array("及时雨","九纹龙","小李广","黑旋风");
document.write("姓名"+" "+"江湖艺名<br/>");
document.write("------------------------------<br/>");
for(i=0;i<names.length;i++){
document.write(names[i]+" "+otherNames[i]+"<br/>");
}
for(var x in names){
alert(names[x]);
}
*/
var hashNames={"及时雨":"宋江","豹子头":"林冲"};
hashNames["狮子头"]="刘欢";
for(var msg in hashNames){
document.write(hashNames[msg]);
}
</script>
</head>
<body>
</body>
</html>
数组的使用
最新推荐文章于 2024-10-30 18:24:25 发布