JavaScript delete operator

Understand the basics of the JavaScript delete operator

ThisdeleteJavaScript operators are used to remove attributes from objects.

Say you have this object:

const car = {
  model: 'Fiesta',
  color: 'green'
}

you can use itdeleteoperator:

delete car.model

You can also refer to properties/methods using square bracket syntax:

delete car['color']

Download mine for freeJavaScript beginner's manual


More js tutorials: