'use strict';

/**
* Sample elements from an array-like object.
*
* @module @stdlib/math/generics/random/sample
*
* @example
* var sample = require( '@stdlib/math/generics/random/sample' );
*
* var out = sample( 'abc' );
* // returns e.g. [ 'a', 'a', 'b' ]
* out = sample( [ 3, 6, 9 ] );
* // returns e.g. [ 3, 9, 6 ]
*
* bool = out.length === 3;
* // returns true
*
* var mysample = sample.factory( 323 );
* out = mysample( [ 3, 6, 9 ], {
*     'size': 10
* });
* // returns [ 3, 9, 3, 3, 3, 6, 3, 3, 3, 6 ]
*/

// MODULES //

var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
var sample = require( './sample.js' );
var factory = require( './factory.js' );


// METHODS //

setReadOnly( sample, 'factory', factory );


// EXPORTS //

module.exports = sample;

'use strict';

/**
* Sample elements from an array-like object.
*
* @module @stdlib/math/generics/random/sample
*
* @example
* var sample = require( '@stdlib/math/generics/random/sample' );
*
* var out = sample( 'abc' );
* // e.g., returns [ 'a', 'a', 'b' ]
*
* out = sample( [ 3, 6, 9 ] );
* // e.g., returns [ 3, 9, 6 ]
*
* var bool = ( out.length === 3 );
* // returns true
*
* @example
* var sample = require( '@stdlib/math/generics/random/sample' );
*
* var mysample = sample.factory( 323 );
* var out = mysample( [ 3, 6, 9 ], {
*     'size': 10
* });
* // returns [ 3, 9, 3, 3, 3, 6, 3, 3, 3, 6 ]
*/

// MODULES //

var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
var sample = require( './sample.js' );
var factory = require( './factory.js' );


// METHODS //

setReadOnly( sample, 'factory', factory );


// EXPORTS //

module.exports = sample;

Update return value annotations and update example
Update return value annotations and update example
