`for (; number > 0 && sampled_indices.length > 0; --number) {`

I try never to side effect in a sub-expression. Always make it a separate statement.