Remove side effect from array.some callback#184919
Conversation
Tyriar
left a comment
There was a problem hiding this comment.
The change looks good, but I'm missing where the side effect is?
|
The |
Tyriar
left a comment
There was a problem hiding this comment.
Oh I thought you meant _getTerminalObjectIndexById has a side effect. I wouldn't call .some setting some value outside it's callback a problem, it's basically the same thing as doing it with a for loop. Regardless, the code looks better with your changes so thanks 🙂
It's a problem it you want to tree-shake the code and expect calls to |
somemethod callback is supposed to be side-effect free. Also,findIndexis now well supported