Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
x3n0ph3n3
on Aug 25, 2023
|
parent
|
context
|
favorite
| on:
Why does all() return True if the iterable is empt...
That's exactly how Ruby behaves.
michaelteter
on Aug 25, 2023
[–]
Ruby and Python agree on the all/any functions, but they disagree on the if. And in the "if", I think the Ruby result is better.
earthboundkid
on Aug 25, 2023
|
parent
[–]
JavaScript thinks empty arrays are true and it’s annoying because you have to write if (a.length) instead of if (a).
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: