json.sort

From RPTools Wiki
Revision as of 21:15, 9 March 2009 by Verisimilar (talk | contribs) (Initial write-up.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.

json.sort() Function

Introduced in version 1.3b51
Used to sort JSON arrays. If the array contains only numbers, they are sorted numerical, otherwise the values are sorted as strings alphabetically.

Usage

json.sort(array)
json.sort(array, direction)

Parameters

  • array - The JSON array to sort.
  • direction - Defaults to "ascending", acceptable values:
    • "ascending"
    • "descending"
    • "ascend"
    • "descend"
    • "asc"
    • "desc"
    • "a"
    • "d"