I’m not sure what that’s supposed to mean,…

And you haven’t offered any ‘better’ solution here…

findIndex() returns the index of the first item matching the condition - which is EXACTLY what’s needed here.

why would there be more than one item in the list with the same ID (although, personally I always use object arrays for this, not strings) - and what would the intended behaviour be if there were duplicate IDs in the list?

In any case, that’s an entirely different question - but obviously if you need to change Multiple items then a different method needs to be used.

If you do this right, in my opinion/experience it really is the best way to do it (much simpler, cleaner, and more efficient than any alternatives I’ve seen or tried).

But I’d be interested to hear your ‘better’ way…