I have an array of values like:
item1, item3, item2, item4, item5, item8, item6, item9, item10, item7, item11
When i sort them in javascript using .sort()
i get the below result:
item1, item10, item11, item2, item3, item4, item5, item6, item7, item8, item9
I know this is because the items are strings and this what sort()
is designed to do, but how can i sort them into the following?
item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11
thanks,