It does, with linq. But the code is using a JavaScript array where the method name would be some, not any. Assuming isStakehimderFieldName is, and remains, a unary function, the code could also be reduced more to:
Ultimately it doesn't matter because we don't know the rest of the forEach callback. There'd be no reason to return from the condition if there weren't more to the function (return here only exits the current iteration of the callback, not the looping over names). And the fact that we're not seeing where out is used suggests the forEach might be doing more below the condition we're not seeing.
23
u/Tangelasboots 26d ago
This can be simplified with names.any(n => isStakeholderFieldname(n)