OPERATIONS IN JS OBJECTS:
ACCESSING OBJECTS: Access an object’s properties using either dot notation or bracket notation.
EXAMPLE:
let Data = {
name: "vinoth",
age: 23
}
console.log(Data.name);
console.log(Data.age);
MODIFYING OBJECTS: Properties in an object can be modified by reassigning their values.
EXAMPLE:
let Data = {
name: "vinoth",
age: 22
}
console.log(Data);
data.age = 23;
console.log(Data);
ADDING PROPERTIES ON OBJECT: Dynamically add new properties to an object using dot or bracket notation.
EXAMPLE:
let car = {
model: "Audi" };
car.color = "White";
console.log(car);
REMOVING PROPERTIES FROM AN OBJECT: The delete operator removes properties from an object.
EXAMPLE:
let car = {
model: "Tesla",
color: "Red"
}
delete car.color;
console.log(car);

Top comments (0)