I have an array of values that look like this:
var myArr = ["S1_FORM", "S3_FORM", "S2_FORM", "S2_2_FORM"];
I need to sort them from lowest to highest.
The way I would like this array to be is like this:
["S1_FORM", "S2_FORM", "S2_2_FORM", "S3_FORM"]
Basically these numbers should be read like: 1, 2, 2.2, 3
How could I achieve this?
I have tried using .sort() but it returns:
["S1_FORM", "S2_2_FORM", "S2_FORM", "S3_FORM"]
notice "2_2" comes before "2_". It shouldn't.