I need to sort an array of this format, using plain old Javascript.
var arr = ["0.01 BASIC", "0.01 SEF", "0.015 BASIC"];
What I need is for the array to be sorted first by decimal then by string and produce an output just like below;
arr = ["0.01 BASIC", "0.015 BASIC", "0.01 SEF"];
I cannot use jquery in performing the sort. Just plain good old Javascript.
sort
function. Have a look here developer.mozilla.org/en-US/docs/JavaScript/Reference/… – elclanrs Apr 9 '13 at 6:47Plain old JS has a sort function
true, but it will not fulfill the requirement he specified for sorting with precedence. – Feisty Mango Apr 9 '13 at 6:48sort
to fulfill the requirement. – elclanrs Apr 9 '13 at 6:54