Home | Mailing List | Blog | Tutorial Videos

Deleting Properties from an Object

Which of the following is a valid way to delete the property color from the car object?

const car = {
  make: 'Mercedez Benz',
  year: '2019',
  color: 'black'
};

// A
car.delete('color');

// B
delete car.color;

// C
delete car[color];

// D
car.color.delete();

Select one: