■複数の配列を連結したい


<!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">
<!--
yama1 = new Array("富士山","立山","阿蘇山","大雪山");
yama2 = new Array("鳥海山","蔵王山","利尻岳","伊吹山");
document.write("<p>●配列yama1,2の内容<br>");
document.write("yama1 = 「"+yama1.join("/")+"」<br>");
document.write("要素数="+yama1.length+"<br>");
document.write("yama2 = 「"+yama2.join("/")+"」<br>");
document.write("要素数="+yama2.length+"</p>");
document.write("<p>●2つの配列を連結する<br>");
all_yama = yama1.concat(yama2);
document.write("all_yama = 「"+all_yama.join('/')+"」<br>");
document.write("要素数="+all_yama.length+"</p>");
// -->
</script>
</body>
</html>



★解説★