https://github.com/leochan2017/zgjm
微信小程序
来,快点掏出你的大手机,打开微信扫一扫吧
var arr = [];
for (i of dreamsData) {
arr.push(i.group)
}
[...new Set(arr)];
var groupArr = [];
for (i of dreamsData) {
groupArr.push(i.group);
}
groupArr = [...new Set(groupArr)];
var bigTiteList = [];
for (itemGroup of groupArr) {
var itemTitleList = [];
for (j of dreamsData) {
if (j.group == itemGroup) {
itemTitleList.push(j.title);
}
}
itemTitleList = [...new Set(itemTitleList)];
bigTiteList.push(itemTitleList);
}
bigTiteList = [...new Set(bigTiteList)];
JSON.stringify(bigTiteList);