<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>拆分字符串,存入数组</title>
<style>
*{padding:0;margin:0;}
</style>
</head>
<body>
<script type="text/javascript">
var fruitarray = [];
fruitarray[0] = ['strawberry','orange'];
fruitarray[1] = ['lime','peach','banana'];
fruitarray[2] = ['tangerine','apricot'];
fruitarray[3] = ['raspberry','kiwi'];
//方法一,concat()直接连接
var total=fruitarray[0].concat(fruitarray[1],fruitarray[2],fruitarray[3])
alert(total[5]);
//方法二,利用concat.apply([],array)直接传入数组
var a=[];
var total=a.concat.apply([],fruitarray);
//此处a还可以直接用Array.prototype代替
</script></body></html>