Difference between order and sort
Difference between order and sort
highflying
Posts: 9Questions: 5Answers: 0
Seems like order and sort are used interchangeably. Can someone describe to me the difference between the two? The sort() page doesn't do a good job in showing examples of one vs the other.
Thanks in advance.
This question has accepted answers - jump to:
This discussion has been closed.
Answers
There is no difference.
The Examples index actually says "Default ordering (sorting)".
Actually there is a difference between
sort()
andorder()
. To try and be consistent with naming:sort()
) refers to sorting the data in an API's result set. e.g you can dotable.column(0).data().sort()
to get an "array" of data from the first column which is sorted in the array, without effecting the table's ordering. Think of it likeArray.prototype.sort()
.I've tried to be consistent in the documentation to match the above, but before 1.10, the two terms were used interchangeably which certainly leads to confusion (and the odd mistake from me!).
Allan
Thanks Allan that helps a lot!