How can I check for duplicates in data query results?

I’m trying to see if there are multiple entries on the same date in a data collection, and if there are I’d like to log them to look something like the chrome console, where they’re grouped together and numbered, as opposed to on individual lines. Ideally I’d be able to store the returned results with a count of each duplicate instance. Below is my code, and the screen shots are the wix console and the chrome console.

wixData . query ( “sessionTracking” )
. include ( “createdDate” )
. find ()
. then (( results ) => {
for ( let i = 0 ; i < results . items . length ; i ++){
if ( results . items . length > 0 ) {
let date = results . items [ i ]. _createdDate . toLocaleDateString ();
console . log ( date );
} else {
console . log ( “No results found” );
}
}
})

Hi!

Please use group() function.