function sample1( x, options ) {
		var replace;
		var xcopy;
		var probs;
		var opts;
		var size;
		var err;

		if ( !( isArrayLike( x ) || isTypedArrayLike( x ) ) ) {
			throw new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', x ) );
		}
		if ( isString( x ) ) {
			x = x.split( '' );
		}
		opts = {};
		if ( arguments.length > 1 ) {
			err = validate( opts, options );
			if ( err ) {
				throw err;
			}
		}
		if ( opts.replace === void 0 ) {
			replace = conf.replace;
		} else {
			replace = opts.replace;
		}
		if ( opts.probs !== void 0 ) {
			probs = opts.probs;
		}
		if ( opts.size ) {
			size = opts.size;
		} else if ( conf.size ) {
			size = conf.size;
		} else {
			size = x.length;
		}
		if (
			replace === false &&
			size > x.length
		) {
			throw new RangeError( format( 'invalid option. `size` option must be less than or equal to the length of `x` when `replace` is `false`. Option: `%s`.', size ) );
		}
		// Custom probabilities...
		if ( probs ) {
			if ( replace ) {
				return vose( x, size, rand, probs );
			}
			return renormalizing( x, size, rand, probs );
		}
		// All elements equally likely...
		if ( replace ) {
			return discreteUniform( x, size, rand );
		}
		xcopy = slice.call( x );
		return fisherYates( xcopy, size, rand );
	}
Samples elements from an array-like object.

@private
@param {(ArrayLike|TypedArrayLike)} x - array-like object from which to sample elements
@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 less than or equal to the length of `x` when the `replace` option is `false`
@returns {Array} sample