function indexed( x, idx, predicate ) {
	var i;
	var j;
	var k;

	k = 0;
	for ( i = 0; i < idx.length; i++ ) {
		j = idx[ i ];
		if ( predicate( x[ j ], j, x ) ) {
			idx[ k ] = j;
			k += 1;
		}
	}
	idx.length = k;
	return idx;
}
Returns an array of indices corresponding to the elements of an input array which pass a test implemented by a predicate function.

@private
@param {Collection} x - input array
@param {Array<number>} idx - list of indices
@param {Function} predicate - predicate function
@returns {Array<number>} updated list of indices

@example
var zeroTo = require( '@stdlib/array/base/zero-to' );

function predicate( v ) {
    return ( v > 0 );
}

var x = [ -1, 2, 3, -4, 5 ];
var idx = zeroTo( 5 );

var out = indexed( x, idx, predicate );
// returns [ 1, 2, 4 ]