const isToday = (someDate) => {
const today = new Date()
return someDate.getDate() == today.getDate() &&
someDate.getMonth() == today.getMonth() &&
someDate.getFullYear() == today.getFullYear()
}
Array.from({length: 10000}).forEach(i=>{
const randomDate = new Date(+(new Date()) - Math.floor(Math.random()*10000000000))
isToday(randomDate)
})
const isToday = (someDate) => {
return new Date().toDateString() == someDate.toDateString()
}
Array.from({length: 10000}).forEach(i=>{
const randomDate = new Date(+(new Date()) - Math.floor(Math.random()*10000000000))
isToday(randomDate)
})