how can I sort the below array in ascending order in JS?
let obj_list = [{Sno:"1"},{Sno:"4"},{Sno:"3"},{Sno:"9"},{Sno:"9.1"},
{Sno:"9.2"},{Sno:"9.6"},{Sno:"9.3"},{Sno:"9.10"},
{Sno:"9.11"},{Sno:"9.13"},{Sno:"9.12"}];
I tried the normal sort function as written below, but the output was coming incorrect
obj_list.sort(function(a,b){
return a.Sno - b.Sno;
});
UPDATING the Post:
I am expecting the output as:
[{Sno:"1"},{Sno:"3"},{Sno:"4"},{Sno:"9"},{Sno:"9.1"},
{Sno:"9.2"},{Sno:"9.3"},{Sno:"9.6"},{Sno:"9.10"},
{Sno:"9.11"},{Sno:"9.12"},{Sno:"9.13"}]