# sort

    array sort(array, flags, language)

Returns a copy of array sorted according to flags.

Flags:

Flag | Description
--- | ---
`"r"` | Reverse (descending) order
`"lc"` | Language sensitive lexicographic (collate) order
`"l"` | Lexicographic order, the default
`"li"` | Case-insensitive lexicographic order (US-ASCII only)
`"liu"` | Case-insensitive lexicographic order (Unicode, preferred)
`"n"` | Numerical order
`"u"` | Unicode-aware case folding

## Parameters

1. array — array to sort.
2. flags — optional text where each character is a flag.
3. language — optional language code, defaults is the device language.

## Returns

- a sorted copy of array, or `null` if empty.