I used .some() coupled with .includes() a while back to cross-reference two string arrays to make sure the user had at least one of the required roles for an action. The benefit of .some() here is that it will return true no matter how many of the iterations are false, as long as one of them is true.
It is quite handy!
I used
.some()
coupled with.includes()
a while back to cross-reference two string arrays to make sure the user had at least one of the required roles for an action. The benefit of.some()
here is that it will return true no matter how many of the iterations are false, as long as one of them is true.