function reverse
reverse(thing: string): string

Reverses the given string or list.

If the thing provided is a string, then it will return the string in reverse respecting all characters.

If the thing is a list, then it will reverse all items in the list.

Examples

Example 1

reverse('Apple'); // "elppA"
reverse([1, 2, 3]); // [3, 2, 1]
reverse(new Set([1, 2, 3])); // Set[3, 2, 1]

Parameters

thing: string

Return Type

string
reverse<T>(thing: T[]): T[]

Type Parameters

Parameters

thing: T[]

Return Type

T[]
reverse<T>(thing: Set<T>): Set<T>

Type Parameters

Parameters

thing: Set<T>

Return Type

Set<T>