function normalizeIndex( idx, max ) {
	var index = normalize( idx, max );
	if ( index < 0 || index > max ) {
		throw new RangeError( format( 'invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.', max, idx ) );
	}
	return index;
}
Normalizes an index before performing a strict bounds check.

@private
@param {integer} idx - index
@param {NonNegativeInteger} max - maximum index
@throws {RangeError} index out-of-bounds
@returns {integer} index

@example
var idx = normalizeIndex( 1, 10 );
// returns 1

idx = normalizeIndex( -4, 10 );
// returns 7

idx = normalizeIndex( -100, 10 );
// throws <RangeError>