It has several properties, including its make, model, colour, and year, as well as several ways or functions, such as starting the engine, changing gears, and turning on the headlights.
1. Dot notation: You can add a new property to an object by using dot notation and assigning a value to a new or existing key.
2. Bracket notation: Using bracket notation and assigning a value to a new or existing key, you can also add a new property to an object.
3. Object.assign(): When you merge an object with another object, you can add properties to the merged object. This method copies the properties from one or more source objects to a target object.
4. Spread operator: You can also use the spread operator to add properties to an object. This method makes a new object that has all of the properties of the original object plus the properties that you tell it to have.
You can remove a property from an object using bracket and dot notation and the delete keyword as follows: