I have an array of integers of type string.
var a = ['200','1','40','0','3'];
Exit
>>> var a = ['200','1','40','0','3']; console.log(a.sort()); ["0", "1", "200", "3", "40"]
I will also have an array of mixed type. eg.
var c = ['200','1','40','apple','orange'];
Exit
>>> var c = ['200','1','40','apple','orange']; console.log(c.sort()); ["1", "200", "40", "apple", "orange"]
====================================================
Integers of type string are not sorted.
source share