array-invert

1.0.2 • Public • Published

array-invert

NPM version build status Test coverage

Invert a JavaScript array. Though you probably want to use array.reverse() instead.

Installation

$ npm i --save array-invert

Overview

var invert = require('array-invert');
 
invert([1, 2, 3, 4, 5]);
// => [5, 4, 3, 2, 1]

API

invert(array)

Invert the order of an array.

invert(['chicken', 'cow', 'pig']);
// => ['pig', 'cow', 'chicken']

License

MIT © Yoshua Wuyts

/array-invert/

    Package Sidebar

    Install

    npm i array-invert

    Weekly Downloads

    7

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • yoshuawuyts