js循环二维数组,输出左下半区
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
var bigArr=[]
var smallArr=[]
for(var i=1;i<=25;i++){
smallArr.push(i)
if(smallArr.length===5){
bigArr.push(smallArr);
smallArr=[]
}
}
for(var j=0;j<bigArr.length;j++){
// console.log(bigArr[j])
bigArr[j].length=j+1;
}
console.log(bigArr);
</script>
</body>
</html>