3 ms·
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
by EdHominem 10y 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.
- psyklic 10y agoGood catch! If only other languages were as simple :D