Skip to content

Reversed

ricardoboss edited this page Oct 16, 2023 · 2 revisions

Description

reversed returns a new list or string with the elements/characters in reverse order.

Syntax

reversed(list subject)
reversed(string subject)
  • subject is the list/string to reverse.

Remarks

  • reversed is a pure function and doesn't modify the original list/string.

Examples

reversed([1, 2, 3]) // [3, 2, 1]
reversed("abc") // "cba"