Delete Keyword to Remove Object Properties

Tell us what’s happening:
tell me please, why is my code not accepted? when checking in safary and chrome everything is fine

delete foods.oranges;
delete foods.plums;
delete foods.bananas;

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.plums;
delete foods.bananas;
// change code above this line

console.log(foods);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.1 Safari/605.1.15.

Challenge: Use the delete Keyword to Remove Object Properties

Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-data-structures/use-the-delete-keyword-to-remove-object-properties

The instructions say to delete strawberries not bananas. :slight_smile:

Sorry!!! Probably it’s time to give the brains a break!)
Thank’s for help!)

1 Like

Haha don’t be sorry we all make dumb mistakes haha. But yes breaks are good. :sweat_smile:

1 Like