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.
sortfunction. Have a look here developer.mozilla.org/en-US/docs/JavaScript/Reference/…Plain old JS has a sort functiontrue, but it will not fulfill the requirement he specified for sorting with precedence.sortto fulfill the requirement.