
{'category': '0101'},
{'category': '010101'},
{'category': '01010101'},
{'category': '01010102'},
{'category': '01010103'},
{'category': '010102'},
{'category': '0102'},
{'category': '010201'},
{'category': '010202'},
{'category': '02'},
{'category': '020101'},
{'category': '020102'} ];
var res=datafilter((o)=>ocategorylength==2)map((o)=>{
osub=datafilter((o1)=>o1categorysubstr(0,2)==ocategory&&o1categorylength==4)map((o1)=>{
o1sub=datafilter((o2)=>o2categorysubstr(0,4)==o1category&&o2categorylength==6)map((o2)=>{
o2sub=datafilter((o3)=>o3categorysubstr(0,6)==o2category&&o3categorylength==8);
return o2;
});
if(!o1sublength)o1sub=datafilter((o2)=>o2categorysubstr(0,4)==o1category&&o2categorylength==8);
return o1;
});
if(!osublength)osub=datafilter((o1)=>o1categorysubstr(0,2)==ocategory&&o1categorylength==6);
return o;
});
consolelog(res);
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)