var arrN = [[[1, "wangyuchu", 54, [123, 34, [123, 34, 16]]],"zhangsan", 25, [1, "wangyuchu", 54, [123, 34, [123, 34, [1, "wangyuchu", 54, [123, 34, [123, 34, 16]]],]]], 43], ["lisi", 21, 172], ["wangwu", 32, "suzhou"]]; var arrgroup=[]; function recursion(obj) { if (typeof obj==='object') { for (var j in obj) { if (typeof obj[j]!=='object') { arrgroup.push(obj[j]); continue; } recursion(obj[j]); } } else { arrgroup.push(obj); } return arrgroup; } console.log(recursion(arrN));