Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Sort Dates JavaScript

var l = [new Date(2022, 10, 10), new Date(2022, 10, 8), new Date(2022, 10, 6), new Date(2022, 10, 15), new Date(2022, 10, 2)];
console.log(l.sort((date1, date2)=>date1-date2));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Sort #Dates #JavaScript
ADD COMMENT
Topic
Name
7+4 =