<script> // 将数组分成三个 var arr = [1,2,3,4,5,6,7,8,9]; var test = []; for(var i=0;i<arr.length;i+=3){ test.push(arr.slice(i,i+3)); } console.log(test); </script>