Need some help with delete Keyword to Remove Object Properties challenge

I tried making a function to do just this, since I ran into similar problems. However, I keep getting a syntax error in the console, and it isn’t working to complete the challenge. I don’t see any syntax errors or anything that shouldn’t work. Anyone have any ideas what would make this work?
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-data-structures/use-the-delete-keyword-to-remove-object-properties

let foods = {
  apples: 25,
  oranges: 32,
  plums: 28,
  bananas: 13,
  grapes: 35,
  strawberries: 27
};

// change code below this line
function Delete(arr, objName) {
  let newName = objName.replace(/"+/g, "");
  while (let i = 0; i < arr.length; i++) {
    delete newName[arr[i]];
  }
}

Delete(["oranges", "plums", "strawberries"], "foods");
// change code above this line

console.log(foods);

My mistake. I thought that I should post within the thread already about the particular challenge rather than make a new topic.

I made the corrections you suggested and was able to make the function work. Thanks for the pointers.