Yeah…

Surely it’s easier, and more efficient, to use an array here…

Then just find the index of the item (using findIndex()) and reassign the value for that item.