■配列を作成したい


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>配列を作成したい</title>
</head>
<body>
<p>■配列を作成したい</p>
<script type="text/JavaScript">
<!--
youbi = new Array("日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日");
today = new Date();
document.write("<p>配列youbiの要素数 = "+youbi.length+"</p>");
document.write("<p>配列の内容は以下のとおりです。<br>");
for (i=0 ; i<youbi.length ; i++) {
document.write("youbi["+i+"] = "+youbi[i]+"<br>")
}
document.write("<p>今日は"+youbi[today.getDay()].bold()+"です。</p>");
// -->
</script>
</body>
</html>



★解説★