Javascript Sorting - Example 1

Basic sorting

This page demostrates the base Javascript sort method. It will display a test array and a sorted version of the array.

For more information return to the article "Sort Your Data with Javascript".

Example code

var wordList = new Array( "red", "green", "blue");
wordlist.sort();

This table contains the original array and the sorted array.

# Original Array Sorted Array
1
2
3