Public
Edited
Oct 10, 2023
Insert cell
Insert cell
datas =
[
{
"category": 0,
"type": "购物",
"money": 23,
"remark": "",
"time": "2023-07-12"
},
{
"category": 0,
"type": "购物",
"money": 23,
"remark": "",
"time": "2023-07-11"
},
{
"category": 0,
"type": "购物",
"money": 23,
"remark": "",
"time": "2023-07-11"
},
{
"category": 0,
"type": "购物",
"money": 23,
"remark": "",
"time": "2023-07-05"
}
];
Insert cell
array = [];
Insert cell
{
datas.forEach((data) => {
const result = array.find((e) => {
console.log(e[0].time, data.time)
return e[0].time == data.time;
})
if (result) {
result.push(data);
} else {
array.push(Array(data));
}
})

return array;
}
Insert cell
{
let array = [ 1, "2", 3 ];

return array[1];
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more