Hacker News new | past | comments | ask | show | jobs | submit login

For the any predicate, you want to know if any element satisfies it, which of course, without any elements it can't be satisfied.

If you want the inverse behaviour, you have to verify that all elements do not satisfy it. And that necessarily results in the empty set being falsy on any, but truthy on all.

Also, its just easier to use .any to check if the set is empty or not, in many cases.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: