1.0.10 • Published 6 years ago

get-unique-random-array v1.0.10

Weekly downloads
2
License
MIT
Repository
github
Last release
6 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

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago