Created
July 3, 2020 07:42
-
-
Save 499978920/280ddca1b09bd36f80f5e3ba2f887245 to your computer and use it in GitHub Desktop.
[JSON 数组排序] json 数组日期排序 #json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sortDate(a,b){ | |
return new Date(a)-new Date(b); | |
} | |
items.sort(sortDate).map(function(a,b){return a.time}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment