Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 0d691a6

Browse files
Ryan Hallpetebacondarwin
Ryan Hall
authored andcommitted
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
1 parent 2022fd7 commit 0d691a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ng/filter/orderBy.js

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

0 commit comments

Comments
 (0)