json.sort: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Initial write-up.)
(No difference)

Revision as of 21:15, 9 March 2009

 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"