contact with properties name and phone.email to the contact object.phone property from the contact object.contact object.contact with properties name and phone.email to the contact object.phone property from the contact object.contact object.contact with these exact properties and values: name set to "Alice" and phone set to "123-456-7890".Use curly braces {} to create an object and separate properties with commas.
email to the contact object and set it to "alice@example.com".Use dot notation to add a new property to an object.
phone property from the contact object using the delete keyword.Use delete object.property to remove a property from an object.
contact object to the console using console.log.Use console.log(contact) to see the object in the console.
Which of the following is the correct way to add a new property age with value 25 to an existing object person?
object.property.person.age = 25; uses correct JavaScript syntax to add a property.Which of the following lines correctly removes the property color from the object car?
delete keyword removes a property from an object.delete car.color; correctly removes the property.What will be the output of the following code?
const obj = {a: 1};
obj.b = 2;
delete obj.a;
console.log(obj);obj.b = 2;, object is {a:1, b:2}.delete obj.a; removes property 'a', so object becomes {b:2}.Find the error in the following code that tries to remove the name property from user:
const user = {name: 'Alice', age: 30};
remove user.name;delete, not remove, to delete properties.user is defined and name is a valid property.remove is invalid in JavaScript. -> Option AYou have an object settings with properties {theme: 'dark', fontSize: 14, showSidebar: true}. You want to remove showSidebar only if it exists, then add a new property language with value 'en'. Which code correctly does this?
'showSidebar' in settings ensures property exists before deletion.settings.language = 'en'; adds the new property properly.delete settings.showSidebar; settings.language == 'en';uses wrong comparison operator
== instead of assignment =. settings.showSidebar = undefined; settings.language = 'en';sets property to undefined but does not remove it.
if (settings.showSidebar) {
settings.showSidebar = null;
}
settings.language = 'en'; sets property to null but does not remove it.Pass the test and this pattern moves unknown