Function sort_strings_by_length

  • Sort input array by number of characters in string (or number cast to string) Will sort ASC by default. Pass second parameter to sort by DESC.

    Returns

    arr - also modifies original array to returned value!

    Parameters

    • arr: string[]

      expects array of strings, but will also accept array of anything, will cast any child to string arr[i].toString()

    • desc: boolean = false

      sort descending? if false or undefined, will be sorted ascending

    Returns string[]

Generated using TypeDoc