sort array by length
This block is part of the array group and was last modified in core v10.4.28.
sort array by length v10.4.28 Sorts an array based on the length of the elements.
- Array required
arrayThe array to be sorted.
- short - long
conditionSort the array from short to long if set to true.
- array
arrayThe array with the items sorted based on length.
Stable-sorts a COPY of the array by the character length of each item's string representation (non-strings are stringified first); the input is not mutated. condition=true sorts short to long; unfilled or false sorts LONG TO SHORT - descending is the default.
sort array by length orders an array by the text length of its items, shortest first by default. Here the sorted result feeds get first item, which picks the shortest value. The condition pin flips the direction when wired.

Version history
Introduced in v10.4.28.
Back to
array Return to the main group to view all sub-groups Back to array Return to the group to view all blocks within this group
