a | string, string to compare |
b | string, string to compare |
xxxxxxxxxx
Standard sorting: Natural order sorting:
img1.png img1.png
img10.png img2.png
img12.png img10.png
img2.png img12.png
xxxxxxxxxx
var a = ["z1.doc", "z10.doc", "z17.doc", "z2.doc", "z23.doc", "z3.doc"];
a.sort(w2utils.naturalCompare);
xxxxxxxxxx
[
"z1.doc",
"z2.doc",
"z3.doc",
"z10.doc",
"z17.doc",
"z23.doc"
]