Category: Sorting Arrays

JavaScript Sorting Arrays

The sort() method sorts an array alphabetically: Reversing an Array The reverse() method reverses the elements in an array. You can use it to sort an array in descending order: Numeric Sort By default, the sort() function sorts values as strings. This works well for strings (“Apple” comes before “Banana”). However, if numbers are sorted as strings, “25” is bigger than “100”, […]

error

Enjoy this blog? Please spread the word :)

RSS20
Follow by Email
Facebook20
Pinterest9