Package Exports
- @jswork/next-sample
- @jswork/next-sample/dist/index.esm.js
- @jswork/next-sample/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jswork/next-sample) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
next-sample
Get an/some element from array like target.
installation
npm install -S @jswork/next-sampleusage
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.