I have an array which i am trying to sort according to real world sizes
["s", "m", "l", "xl", "xxl", "xs"].sort(function(a,b){
if(a === "xs")
});
I am getting this array as response and I have to modify it in front end I have tried to sort it out but i cant find suitable condition to do What should I do such that array is sorted in this order
["xs","s", "m", "l", "xl", "xxl"]
Even If any size is missing it should be in correct order for instance If medium size is not available it should be in correct order
["xs","s", "l", "xl", "xxl"]