> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Array or object: Reverse

> Reverses the order of items in an array or keys in an object.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Reverses the order of a list, so the last item comes first and the first item comes last. Use this to flip the direction of a sequence, for example showing the newest entries before the oldest, or putting a sorted list into descending order.

For a plain list the items are renumbered from the start. For an object the named keys keep their values and only their order changes.

This documentation describes: [Schema](/schemas/mapper/list-reverse)

## Fields

This mapper has no settings. Point it at the list or object you want to reverse and it transforms whatever value it receives.

## Sample data

Input:

```json theme={null}
{ "steps": ["pick", "pack", "ship"] }
```

Output:

```json theme={null}
{ "steps": ["ship", "pack", "pick"] }
```

```json Configuration theme={null}
{
  "prototype": "list-reverse",
  "parameters": {}
}
```
