how do you sort an array with empty strings, NaN, numbers and infinity
<p>I'm trying to sort an array that includes empty strings, numbers, "infinity", "-infinity", and "NaN". I am receiving all the values in form of strings, so sort is not working as expected when it comes to empty strings, inf and nan. Is there a way to customize my sort function both in ascending and descending order?</p>