
How to sort Array if it contains number string and string data in JavaScript
Doesn't Array.sort output as you expected? It's because number is handled as string by default. If you want to sort the array on your needs, you need to write your own sorting logic.