i have passed this test using this code but is there a faster alternative?
i tried
delete foods['oranges','strawberries','plums']
but didnt work
Your code so far
let foods = {
apples: 25,
oranges: 32,
plums: 28,
bananas: 13,
grapes: 35,
strawberries: 27
};
// change code below this line
delete foods['oranges'];
delete foods['strawberries'];
delete foods['plums'];
// change code above this line
console.log(foods);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-data-structures/use-the-delete-keyword-to-remove-object-properties