# Reverse Array

Reverse an array using lodash _.reverse

> Canonical page: https://elysiatools.com/en/tools/reverse-array

- **Category:** Data Processing

- **Keywords:** array, reverse, order, flip, lodash

## Overview

Reverse the order of items in a JSON array.

**Highlights:**
- Uses lodash `_.reverse` on a cloned array
- Preserves data types and nesting
- Returns the reversed array as JSON

**Example:**
- Array: `[1, 2, 3]`
- Result: `[3, 2, 1]`

## Inputs

- **Array** (textarea): Enter a JSON array

## When to use

- When you need to display data in reverse chronological or sequential order.
- When processing lists that require a last-in-first-out sequence for algorithms or workflows.
- When preparing array data for tasks that expect input in reversed order.

## How it works

- Input a valid JSON array into the provided textarea field.
- The tool clones the array and applies lodash _.reverse to reverse the element order.
- It preserves all data types and nested structures within the array.
- Outputs the reversed array as JSON text for immediate use.

## Use cases

- Reversing a list of timestamps to show the most recent events first in a log.
- Flipping the order of items in a sequence for review or presentation purposes.
- Preparing array data for reverse iteration in programming or data analysis tasks.

## Frequently asked questions

### Does this tool modify the original array?

No, it operates on a cloned array to ensure the original data remains unchanged.

### Can it handle arrays with mixed data types?

Yes, it preserves all JSON-compatible data types, including strings, numbers, objects, and nested arrays.

### What input format is required?

The input must be a valid JSON array, such as [1, 2, 3] or ["a", "b", "c"].

### How is the output provided?

The reversed array is returned as JSON text, which can be copied or used directly.

### Are there any limits on array size?

There are no specified limits, but performance may vary with very large arrays due to system resources.

## Related tools

- [Flatten Deep Array](https://elysiatools.com/en/tools/flatten-deep-array): Flatten array completely using lodash _.flattenDeep
- [Get Path](https://elysiatools.com/en/tools/get-path): Get a value at a path using lodash _.get
- [Group By](https://elysiatools.com/en/tools/group-by): Group items by a derived key using lodash _.groupBy
- [Head Item](https://elysiatools.com/en/tools/head-item): Get the first element of array using lodash _.head
- [Index Of](https://elysiatools.com/en/tools/index-of): Find the index of a value in array using lodash _.indexOf
- [Initial Items](https://elysiatools.com/en/tools/initial-items): Get all elements except the last using lodash _.initial
- [Intersection Arrays](https://elysiatools.com/en/tools/intersection-arrays): Find common values across multiple arrays using lodash _.intersection
- [Nth Item](https://elysiatools.com/en/tools/nth-item): Get the item at a specific index using lodash _.nth

## Samples

- [Grafana Advanced Application Samples](https://elysiatools.com/en/samples/grafana-samples): Comprehensive Grafana samples covering advanced dashboard design, alerting configurations, data source integrations, and plugin development
- [QR Code Samples](https://elysiatools.com/en/samples/qrcode-samples): Sample QR code images for testing QR code reading and generation tools
- [D3.js Data Visualization Samples](https://elysiatools.com/en/samples/d3js-data-visualization): Comprehensive D3.js data visualization examples including charts, maps, animations, and interactive visualizations
- [Rome JavaScript Toolchain Samples](https://elysiatools.com/en/samples/rome): Rome JavaScript toolchain examples including configuration, linting, formatting, bundling, and project management
