Created
October 27, 2014 10:15
-
-
Save dsdstudio/e8fd67e4e1f64b161c25 to your computer and use it in GitHub Desktop.
javascript sort
This file contains 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
page = page.sort(function(a, b) { | |
var $a = a.SEQ || 0; | |
var $b = b.SEQ || 0; | |
if ( $a == $b ) return 0; | |
if ( $a < $b ) return -1; | |
return 1; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment