Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

sort array by date typescript

array.sort((x, y) => +new Date(x.createdAt) - +new Date(y.createdAt));
 
PREVIOUS NEXT
Tagged: #sort #array #date #typescript
ADD COMMENT
Topic
Name
6+3 =