I have a list of times of text messages and I am trying to return the last text message sent on a particular day.
I am new to Javascript maybe this is easy but I just don't know how to do this
This what I have tried I am completely clueless.
My Code:
const texts = [
{
date: "27 Jan 2021",
text: "Hey nice to see you",
time: "12:22",
},
{
date: "27 Jan 2021",
feeling: "Cry",
text: "All good you?",
time: "16:26",
},
{
date: "27 Jan 2021",
text: "You too how's life treating you?",
time: "12:26",
},
]
const output = texts.filter(i=>i.time)
Desired Output:
const output = [
{
date: "27 Jan 2021",
feeling: "Cry",
text: "All good you?",
time: "16:26",
},
]
question from:
https://stackoverflow.com/questions/65917675/javascript-filter-list-by-last-time-of-day-and-return-a-single-value 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…