数组reduce 方法 (arr.reduce )
arr.reduce
var list = arr.reduce(function (total,level0) {
level0.subTagList.forEach(function (level1) {
level1.subTagList.forEach(function (level2) {
if(level2.state){
total.push({
name: level0.tagName + '/' + level1.tagName + '/' + level2.tagName,
id: level2.id,
});
}
});
});
return total;
},[]);