clouder wrote:
> I had some time wrapping my head around this one messing with irb
> 
> I was wondering why b.compact! would change the value of a

I can't work out why you want to build a new (compacted) array in
order to discard it and use the first element. Detect is much more
suitable:

[nil,nil,3, nil, 9, nil].detect{|e| e}
=> 3

Beware of false; you might want to say !e.nil?

Clifford Heath.