Articles in this section

reverse helper

The reverse helper reverses the order of characters in a string. Builders use it in Handlebars templates — including field mappings, response mappings, HTTP request bodies, and dynamic API paths — for tasks such as creating obfuscated identifiers or transforming values during testing.

Usage

{{reverse value}}

value -- The string to reverse. Numbers are converted to strings before reversing. Required.

Examples

Reverse a word

{{reverse record.word}}

Context

{
  "record": {
    "word": "abcde"
  }
}

Output

edcba

Reverse a name

{{reverse record.firstName}}

Context

{
  "record": {
    "firstName": "Jane"
  }
}

Output

enaJ

Notes and constraints

  • The helper works on any string input. Numbers are converted to strings before reversing.
  • Whitespace and punctuation are preserved, in reversed order.