Skip to content

Instantly share code, notes, and snippets.

@499978920
Created July 3, 2020 07:42
Show Gist options
  • Save 499978920/280ddca1b09bd36f80f5e3ba2f887245 to your computer and use it in GitHub Desktop.
Save 499978920/280ddca1b09bd36f80f5e3ba2f887245 to your computer and use it in GitHub Desktop.
[JSON 数组排序] json 数组日期排序 #json
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