Skip to main content

.sort_desc

Arguments for .sort() that sort an array of strings in descending order. This is intended for use with alphabetical strings. Numbers will sort by string precedence.

Syntax

array.sort(#fs.scripts.lib().sort_desc);

Parameters

No known parameters.

Return

Returns an array.

Example

function(context, args) {
const l = #fs.scripts.lib();
const my_array = ["bananas", "apples", "oranges"];

return my_array.sort(l.sort_desc);
}