Hacker News new | ask | show | jobs
by EdHominem 3622 days ago
puts "true" if []

An empty array is still an object, so tests to true. Similarly 0, etc.

The only false values are 'false', of course, and 'nil', the lack of anything.

1 comments

Good catch! If only other languages were as simple :D