<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>数组</title>
</head>
<body>
</body>
<script type="text/javascript">
var arr = [1,2,3,[1,2,3,1,3,[1,2,3,6,4,[1,2,3,1]]],2],a=1;
function multiarr(arr){
for (i=0;i<arr.length;i++){
if(arr[i] instanceof Array){
a++;
arr = arr[i];
multiarr(arr);
}
}
return a;
}
console.log(multiarr(arr));
</script>
</html>