I moved your question out of the other post, because you had a question about your on code instead of helping the OP of the other thread. In the future, just use the Ask for Help button on the challenge, so it brings in your formatted code along with the applicable challenge url.
While loops only have a test condition, so you can not use let i = 0; or i++.
Also, newName is a string which has the value “foods”, so you are attempting to delete an undefined.
All you need to do is pass the foods object into the function, then iterate through arr and delete objName’s properties which are the same as the current value of arr[i].
When responding to another poster’s topic, it is best to stick with either making suggestions to help them or asking for clarification about something they may have written which you are confused about. The point is, the discussion should focus on their code and not your code, which is why we prefer a new topic for each user’s challenge questions. It keeps things more organized.