@jswork/next-sample

1.0.1 • Public • Published

next-sample

Get an/some element from array like target.

version license size download

installation

npm install -S @jswork/next-sample

usage

import '@jswork/next-sample';

const arr = [1,2,3,4,5,6,7];

nx.sample(arr); // 2
nx.sample(arr); // 5

nx.sample(arr, 1); // [5]
nx.sample(arr, 2); // [1, 2]
nx.sample(arr, 2); // [3, 6]
nx.sample(arr, 2); // [5, 6]

license

Code released under the MIT license.

Dependents (4)

Package Sidebar

Install

npm i @jswork/next-sample

Homepage

js.work

Weekly Downloads

68

Version

1.0.1

License

MIT

Unpacked Size

5.83 kB

Total Files

6

Last publish

Collaborators

  • afeiship
  • yujiao.luo