textConvert
    Preparing search index...

    Function reverse

    • Reverses all grapheme clusters (user-perceived characters) in a string.

      Parameters

      • text: string

        A string to reverse.

      Returns string

      Reversed string.

      reverse('Hello, world!'); // '!dlrow ,olleH'
      reverse('👍🏽a'); // 'a👍🏽' -- emoji clusters stay intact