1.0.10 • Published 7 years ago

get-unique-random-array v1.0.10

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

get-unique-random-array Build Status npm

Get a unique random array from an array

Install

$ npm install get-unique-random-array

Usage / API

import getUniqueRandomArray from "get-unique-random-array";
// const getUniqueRandomArray = require("get-unique-random-array").default; // node,commonJS

const targetArray = [
  { id: 1, status: false },
  { id: 2, status: true },
  { id: 3, status: false },
  { id: 4, status: true },
  { id: 5, status: false }
];
const size = 2;

console.log(getUniqueRandomArray(targetArray, { size })); // => [ { id: 4, status: true }, { id: 3, status: false } ]

License

MIT

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago