0

rsort

To sort an array in descending order

This function helps you to sort values in descending order.

đź’ˇ You can pass any number of parameters. Requirement: They have the same data type.

  • If you pass single values (no array), they will be concatenated and returned as a sorted array.
  • When you pass 1 or more arrays, they will be merged and returned as a single sorted array.

Syntax

rsort(any, any, ...)

rsort([any], [any], ...)

More about any >

Return

[any]

Examples

rsort("B", "E", "A", "E", "D", "C")

Result: A,B,C,D,E,E

rsort(["B", "E", "A"], ["E", "D", "C"]) 

Result: A,B,C,D,E,E

See also

sort which sorts an array in ascending order.

Reply

null