Created
August 7, 2013 03:21
-
-
Save sofish/6170911 to your computer and use it in GitHub Desktop.
Revisions
-
sofish created this gist
Aug 7, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ // firefox 和 chrome 是 [1024, 6, 5, 3, 2, 1] // safari 中顺序没变 [1,3,2,5,6,1024].sort(function(a, b) { return b > a; }); // 在各中浏览器工作一致的方法 // 用正负和零来排序,而不是 true/false [1,3,2,5,6,1024].sort(function(a, b) { return b - a; });