Function sort_strings_by_width

  • Sort input array NOT JUST by number of characters in string (like sort_strings_by_length), but instead, sort by width of the "word". Skinny letters like "i" and "l" will be sorted higher (if asc). Wide letters like "w" and "m" will be sorted lower (if asc). To sort wider strings higher, set desc to true.


    arr - also modifies original array to returned value!


    • 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