0.0.4 • Published 7 years ago

random-array-element-ts v0.0.4

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

random-array-element-ts

Select a random element from an array (in a typesafe way using TypeScript).

Install

$ npm install --save random-array-element-ts

Usage

import {randomArrayElement} from 'random-array-element-ts';

const arr1 = [1, 2, 3];
const result: number = randomArrayElement(arr1);

const arr2 = ['one', 'two', 'three'];
const result: string = randomArrayElement(arr2);

License

MIT © Parambir Singh

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago