HexagonJS
Sort Changelog
2.7.1
hx.sort
Deprecated
The hx.sort methods have been renamed to explict functions: hx.compare, hx.compareNullsLast, hx.localeCompare
2.7.0
hx.sort
Deprecated
The hx.sort methods have been renamed to explict functions: hx.compare, hx.compareNullsLast, hx.localeCompare
2.5.3
hx.sort
Deprecated
The hx.sort methods have been renamed to explict functions: hx.compare, hx.compareNullsLast, hx.localeCompare
2.5.2
hx.sort
Deprecated
The hx.sort methods have been renamed to explict functions: hx.compare, hx.compareNullsLast, hx.localeCompare
2.5.1
hx.sort
Deprecated
The hx.sort methods have been renamed to explict functions: hx.compare, hx.compareNullsLast, hx.localeCompare
2.5.0
hx.sort
Deprecated
The hx.sort methods have been renamed to explict functions: hx.compare, hx.compareNullsLast, hx.localeCompare
2.4.0
hx.sort
Deprecated
The hx.sort methods have been renamed to explict functions: hx.compare, hx.compareNullsLast, hx.localeCompare
2.3.1
hx.sort
Deprecated
The hx.sort methods have been renamed to explict functions: hx.compare, hx.compareNullsLast, hx.localeCompare
2.3.0
hx.sort
Deprecated
The hx.sort methods have been renamed to explict functions: hx.compare, hx.compareNullsLast, hx.localeCompare
2.2.0
hx.sort
Deprecated
The hx.sort methods have been renamed to explict functions: hx.compare, hx.compareNullsLast, hx.localeCompare
2.1.0
hx.sort
Deprecated
The hx.sort methods have been renamed to explict functions: hx.compare, hx.compareNullsLast, hx.localeCompare
2.0.3
hx.sort
Deprecated
The hx.sort methods have been renamed to explict functions: hx.compare, hx.compareNullsLast, hx.localeCompare
2.0.2
hx.sort
Deprecated
The hx.sort methods have been renamed to explict functions: hx.compare, hx.compareNullsLast, hx.localeCompare
2.0.1
hx.sort
Deprecated
The hx.sort methods have been renamed to explict functions: hx.compare, hx.compareNullsLast, hx.localeCompare
2.0.0
hx.sort
Deprecated
The hx.sort methods have been renamed to explict functions: hx.compare, hx.compareNullsLast, hx.localeCompare
hx.compareNumber
Added
A function to compare two items and return a number based on the priority. It takes into account the character order of text and the numeric order of numbers, as opposed to a standard text sort.
array = ['20','1','100']
array.sort() // returns ['1', '100', '20']
array.sort(hx.sort.compare) // returns ['1', '20', '100']
hx.localeCompare
Added
A function to return a localised sort function to use directly when calling array.sort.
It takes into account the character order of text for a specific locale and the numeric order of numbers.
Some browsers don't support the locale and options parameters.
Browser support and accepted values for the locale and options parameters can be found on the
svCompare = hx.sort.localeCompare('sv')
array.sort(svCompare)
svCompare in the above example would evaluate to:
function(a, b){
  return hx.sort.localeCompare(a, b, 'sv')
};
hx.compareNullsLastNumber
Added
A sort function that sorts nulls to the end of an array.
1.11.0
hx.sort
compareNumber
Bugfix
#372
Resolved an issue where sorting with undefined would treat it as a string.
hx.sort
localeCompareFunction
Bugfix
#372
Resolved an issue where sorting with undefined would treat it as a string.
hx.sort
localeCompareoptionsObject
options
nullsLastBoolean
Added
#372
Added an option for sorting nulls to the end of an array when using localeCompare.
hx.sort
compareNullsLastNumber
Added
#372
Added an function for sorting nulls to the end of an array.
1.0.0
hx.sortArray[Any]
Added
Sorts an array without modifying it
hx.sortByArray[Any]
Added
Sorts an array without modifying it. The resultant array is sorted by the value obtained by calling f on each member of the array.