docs(orderBy): clarify how sorting is processed

An API was passing me numbers as strings (ex. '8.25'), and I was noticing
weird sorting behavior with `orderBy` because it was trying to sort the
numbers alphabetically.

Closes #5436
This commit is contained in:
Ryan Hall
2013-12-16 11:18:45 -08:00
committed by Peter Bacon Darwin
parent 2022fd768e
commit 0d691a6feb

View File

@@ -6,7 +6,9 @@
* @function
*
* @description
* Orders a specified `array` by the `expression` predicate.
* Orders a specified `array` by the `expression` predicate. It is ordered alphabetically
* for strings and numerically for numbers. Note: if you notice numbers are not being sorted
* correctly, make sure they are actually being saved as numbers and not strings.
*
* @param {Array} array The array to sort.
* @param {function(*)|string|Array.<(function(*)|string)>} expression A predicate to be