[ { current: 104.54, timestamp: 1722223800000, // 2024-07-29 11:30:00, time: '2024-07-29 11:30:00' }, { current: 105.18, timestamp: 1722216600000, // 2024-07-29 09:30:00 time: '2024-07-29 09:30:00' }, { current: 108.18, timestamp: 1722223802000, //2024-07-29 11:30:01, time: '2024-07-29 11:30:02' }, { current: 106.18, timestamp: 1722223801000, //2024-07-29 11:30:01, time: '2024-07-29 11:30:01' } ] 对这个数组处理,要求 1.根据timestamp时间排序 2.通过dayjs对timestamp转成HH:mm 3.转过之后的数据,timestamp有重复的,去重的时候,只保留current最大的一项,比如108.18 最后输出 [ { current: 105.18, timestamp: '09:30', // 2024-07-29 09:30:00 time: '2024-07-29 09:30:00' }, { current: 108.18, timestamp: '11:30', // 2024-07-29 09:30:00 time: '2024-07-29 09:30:00' }, ]
理解问题[ { current: 104.54, timestamp: 1722223800000, // 2024-07-29 11:30:00, time: '2024-07-29 11:30:00' }, { current: 105.18, timestamp: 1722216600000, // 2024-07-29 09:30:00 time: '2024-07-29 09:30:00' }, { current: 108.18, timestamp: 1722223802000, //2024-07-29 11:30:01, time: '2024-07-29 11:30:02' }, { current: 106.18, timestamp: 1722223801000, //2024-07-29 11:30:01, time: '2024-07-29 11:30:01' } ] 对这个数组处理,要求 1.根据timestamp时间排序 2.通过dayjs对timestamp转成HH:mm 3.转过之后的数据,timestamp有重复的,去重的时候,只保留current最大的一项,比如108.18 最后输出 [ { current: 105.18, timestamp: '09:30', // 2024-07-29 09:30:00 time: '2024-07-29 09:30:00' }, { current: 108.18, timestamp: '11:30', // 2024-07-29 09:30:00 time: '2024-07-29 09:30:00' }, ]
已完成理解「[ { current: 104.54, timestamp: 1722223800000, // 2024-07-29 11:30:00, time: '2024-07-29 11:30:00' }, { current: 105.18, timestamp: 1722216600000, // 2024-07-29 09:30:00 time: '2024-07-29 09:30:00' }, { current: 108.18, timestamp: 1722223802000, //2024-07-29 11:30:01, time: '2024-07-29 11:30:02' }, { current: 106.18, timestamp: 1722223801000, //2024-07-29 11:30:01, time: '2024-07-29 11:30:01' } ] 对这个数组处理,要求 1.根据timestamp时间排序 2.通过dayjs对timestamp转成HH:mm 3.转过之后的数据,timestamp有重复的,去重的时候,只保留current最大的一项,比如108.18 最后输出 [ { current: 105.18, timestamp: '09:30', // 2024-07-29 09:30:00 time: '2024-07-29 09:30:00' }, { current: 108.18, timestamp: '11:30', // 2024-07-29 09:30:00 time: '2024-07-29 09:30:00' }, ]」
展开阅读网页