Hi All,
Im trying to sort the below array in jsp.
var arr = ["5:1313847962519,1313847955548","20:1313847964244" ,"4:1313847962466","11:1313847965024,1313847938900 "];
I want the output as
4:1313847962466
5:1313847962519,1313847955548
11:1313847965024,1313847938900
20:1313847964244
NOTE: All I need to look into is the numbers before the character ":" and sort it.
This code does not work.
var order = arr.sort(function (a, b) {
return ( a-b );
});
Could anyone please suggest me how to do this?