learn-co-students / javascript-objects-bootcamp-prep-000

Other
14 stars 4.32k forks source link

DELETING A KEY-VALUE PAIR IN LAB does not work #2254

Open lampa-da opened 6 years ago

lampa-da commented 6 years ago

`var meals = { breakfast: "oatmeal", lunch: "turkey sandwich", dinner: "steak and potatoes" };

// the delete operator returns true if it has successfully // deleted, false otherwise delete meals.dinner; // true

meals; // returns { breakfast: "oatmeal", lunch: "turkey sandwich" }`

this syntax dose not work in lab

delete playlist[artistName];

hankinyb commented 6 years ago

I got it to pass with the following code:

function removeFromPlaylist(songTitle, artistName) { delete playlist.artistName return playlist }

I think the test is wrong...

vyklimavicius commented 5 years ago

It pass with

delete playlist[artistName] return playlist