'use strict';

// MODULES //

var factory = require( './factory.js' );


// SAMPLE //

var sample = factory();


// EXPORTS //

module.exports = sample;

'use strict';

// MODULES //

var factory = require( './factory.js' );


// SAMPLE //

/**
* Samples elements from an array-like object.
*
* @function sample
* @type {Function}
* @param {ArrayLike} x - array-like object to sample elements from
* @param {Options} [options] - function options
* @param {NonNegativeInteger} [options.size] - sample size
* @param {ProbabilityArray} [options.probs] - element probabilities
* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement
* @throws {TypeError} first argument must be array-like
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {RangeError} `size` option must be smaller or equal to the length of `x` when `replace` is set to false
* @returns {Array} sample
*
* @example
* * var out = sample( [ 3, null, NaN, 'abc', function(){} ] );
* // e.g., returns [ 3, 'abc', null, 3, null ]
*/
var sample = factory();


// EXPORTS //

module.exports = sample;

Add JSDoc comment