slice

種類メソッド
書式 配列 = 配列オブジェクト.slice(開始位置,終了位置)
解説
指定された範囲の配列要素を抜き出します。終了位置は省略できます。
サンプルコード
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<style type="text/css"><!--
body { margin:0px; }
form { position:absolute; top:10;left:10px; }
--></style>
<script type="text/javascript"><!--
window.onload = function()
{
myAry1 = new Array(12,34,"AB","CD",56,78);
n = myAry1.slice(1,3);
document.getElementById("txtField").value = n;
}
// --></script>
</head>
<body>
<img src="Default.png">
<form>
<input type="text" id="txtField" size=40">
</form>
</body>
</html>
実際のスクリプトをダウンロード