Remake array without nils

Dear list,

how could i remake this array with just the elements that fulfil the if condition, without the nils?

(1…8).collect{ arg item; if(item>4,{item})}

thanks,
jan

(1..8).select{ |n| n > 4 }

See the Collection help file for others.

Thank you @jordan, thats it!