Fix Sorting in Javascript

by John H
~1 minute

Normally sort function compare the ascii values of characters.  This becomes and issue when you want numbers like 1,10,2,20 to sort like 1,2,10,20.  To make these numbers sort in a 'natural' order you would need to write and implement the alphanum algorithm that Dave Koelle wrote a million years ago.  Here are some more information on them.

Related Articles

Why is Javascript so popular

The last 4 years has seen Javascript hotness like never before. You have a language that is native...

John H John H
4 minutes

Installing Yarn on Mojave

I was unable to install yarn directly - I had to do a few additional steps for it to actually...

John H John H
~1 minute

Storing and sorting Values in PHP Array

I just had a huge ordeal dealing with an array.  I needed to loop through an array - process some...

John H John H
2 minutes