let arr=res.data.data;
let newobj = {};
arr = arr .reduce((preVal, curVal) => {
newobj[curVal.fromUser] ? '' : newobj[curVal.fromUser] = preVal.push(curVal);
return preVal
}, [])
console.log('這是',arr);
let arr=res.data.data;
let newobj = {};
arr = arr .reduce((preVal, curVal) => {
newobj[curVal.fromUser] ? '' : newobj[curVal.fromUser] = preVal.push(curVal);
return preVal
}, [])
console.log('這是',arr);