Skip to main content
Module

x/lodash_es/mod.ts>reverse

lodash for deno use
Latest
function reverse
import { reverse } from "https://deno.land/x/lodash_es@v0.0.2/mod.ts";

Reverses array so that the first element becomes the last, the second element becomes the second to last, and so on.

Note: This method mutates array and is based on Array#reverse.

Examples

var array = [1, 2, 3];

_.reverse(array); // => [3, 2, 1]

console.log(array); // => [3, 2, 1]

Parameters

array

The array to modify.