skip to Main Content

Javascript – Creating an array of dates efficiently?

I have an availabilities collection. Inside this collection could be a few entries that are date based for example: { "_id": "64b03ed794d87927a3066e13", "startDateTime": "2023-07-07T18:00:00.000Z", "endDateTime": "2023-07-12T15:00:00.000Z", "availabilityType": "blackout" } { "_id": "64b03eb094d87927a3066ddb", "startDateTime": "2023-07-03T18:00:00.000Z", "endDateTime": "2023-07-06T15:00:00.000Z", "availabilityType": "blackout" } I…

VIEW QUESTION

Javascript – I want sort this array with this method

var img = [ "IMG_COM_20220516_1150_41_1375.webp", "IMG_COM_20220516_1150_41_13810.webp", "IMG_COM_20220516_1150_41_1386.webp", "IMG_COM_20220516_1150_41_1389.webp", "IMG_COM_20220516_1150_41_13911.webp", "IMG_COM_20220516_1150_41_13912.webp", ]; I want to sort this array by bigger number when I try .sort() didn't change I want the result be like this [ "IMG_COM_20220516_1150_41_1375.webp", "IMG_COM_20220516_1150_41_1386.webp", "IMG_COM_20220516_1150_41_1389.webp", "IMG_COM_20220516_1150_41_13810.webp", "IMG_COM_20220516_1150_41_13911.webp", "IMG_COM_20220516_1150_41_13912.webp",…

VIEW QUESTION
Back To Top
Search