Array.sort Put 10 Before 2. The Default Sort Is Lexical
Share

JavaScript’s default sort turns every element into a string and compares UTF-16 code units, so numbers come back in the wrong order. The…

 

 JavaScript’s default sort turns every element into a string and compares UTF-16 code units, so numbers come back in the wrong order. The…Continue reading on Medium » Read More JavaScript on Medium 

#java

By ali

Leave a Reply