function iterNth( iterator, n ) {
	var i;
	var v;
	if ( !isIteratorLike( iterator ) ) {
		throw new TypeError( format( 'invalid argument. First argument must be an iterator. Value: `%s`.', iterator ) );
	}
	if ( !isPositiveInteger( n ) ) {
		throw new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', n ) );
	}
	i = 0;
	while ( true ) {
		i += 1;
		v = iterator.next();
		if ( v.done ) {
			return;
		}
		if ( i === n ) {
			return v.value;
		}
	}
}
Returns the nth iterated value.

@param {Iterator} iterator - input iterator
@param {PositiveInteger} n - iteration number
@throws {TypeError} first argument must be an iterator
@throws {TypeError} second argument must be a positive integer
@returns {*} nth iterated value

@example
var array2iterator = require( '@stdlib/array/to-iterator' );

var it = array2iterator( [ 0, 0, 1, 0, 0 ] );

var v = iterNth( it, 3 );
// returns 1