Skip to content

Enables the sampling operation to be executed on an array based on the given element count

License

Notifications You must be signed in to change notification settings

ozcanzaferayan/sondaj.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sondaj.js

npm version

Enables the sampling operation to be executed on an array based on the given element count.

Demo

Demo page

Installation

NPM

npm i sondaj

CDN

<!DOCTYPE html>
<html>
<head>
    <title>A sample app for sampling operation</title>
</head>
<body>
    <script type="text/javascript" src="https://unpkg.com/sondaj@1.0.0/sondaj.js"></script>
</body>
</html>

Usage

var arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
var sampledArray = arr.sondajla(5);
console.log(sampledArray);

Or simply:

console.log([0, 1, 2, 3, 4, 5, 6, 7, 8, 9].sondajla(5));

API

Method

sondajla(samplingCount)

Returns randomized subset of array based on samplingCount.

License

MIT

About

Enables the sampling operation to be executed on an array based on the given element count

Resources

License

Stars

Watchers

Forks

Packages

No packages published