1.0.1 • Published 4 years ago

@bemoje/arr-shuffle v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

@bemoje/arr-shuffle

Shuffle items in an array in-place. Runtime: O(n)

Version

Travis CI

Dependencies

Stats

Donate

Installation

npm install @bemoje/arr-shuffle
npm install --save @bemoje/arr-shuffle
npm install --save-dev @bemoje/arr-shuffle

Usage

import arrShuffle from '@bemoje/arr-shuffle'

arrShuffle([1, 2, 3])
//=> [2, 1, 3] - or some other random order

Tests

Uses Jest to test module functionality. Run tests to get coverage details.

npm run test

API

arrShuffle

Shuffle items in an array in-place. Runtime: O(n)

Parameters
  • arr Array The array to shuffle.
Returns

Array The shuffled array