Array iteration ensure fail

Thank you for your response and sorry I am still pretty new at programming, only been at this for a year now. I did manage to solve the issue by adding returns after adding the item and after updating the quantity. I would, however, like to not be implementing bad practices. How else would I modify the struct value if not during iteration?

1 Like