I have an array of objects which contain a count variable, when I use
let ingredientCount = userItems.find(item => item.objectId == recipeIngredients[ingredient].item)?.count
ingredientCount -= recipeIngredients[ingredient].count;
the actual count in userItems doesn't get changed, the ingredientCount one does instead. any possible fixes or workarounds?