MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/b2o6f2/whats_your_favorite_most_useful_javascript/eivtcki/?context=3
r/javascript • u/Linux_is_awesome • Mar 18 '19
422 comments sorted by
View all comments
Show parent comments
19
TIL about array.every. Awesome tool, thanks!
11 u/Satoshi_Hodler Mar 19 '19 There's a small caveat that it always returns true on empty arrays, which might be not what you need. 27 u/Tysonzero Mar 19 '19 That's the mathematically correct thing to do, it's actually a pretty fundamental mathematical principle. Vacuous truth 1 u/third774 Mar 19 '19 Is there a similar term for .some() always returning false on empty arrays? I suppose it's still "vacuous", right? So maybe "Vacuous Falsity"?
11
There's a small caveat that it always returns true on empty arrays, which might be not what you need.
27 u/Tysonzero Mar 19 '19 That's the mathematically correct thing to do, it's actually a pretty fundamental mathematical principle. Vacuous truth 1 u/third774 Mar 19 '19 Is there a similar term for .some() always returning false on empty arrays? I suppose it's still "vacuous", right? So maybe "Vacuous Falsity"?
27
That's the mathematically correct thing to do, it's actually a pretty fundamental mathematical principle. Vacuous truth
1 u/third774 Mar 19 '19 Is there a similar term for .some() always returning false on empty arrays? I suppose it's still "vacuous", right? So maybe "Vacuous Falsity"?
1
Is there a similar term for .some() always returning false on empty arrays? I suppose it's still "vacuous", right? So maybe "Vacuous Falsity"?
.some()
false
19
u/ahartzog Mar 19 '19
TIL about array.every. Awesome tool, thanks!