Delete Keyword Javascript
deleteis an operator.- It removes a property from an object.
- It only works on properties of an object and nothing else.
const person = {
name: "John",
age: 30,
city: "New York"
};
// Deleting the 'city' property
delete person.city;
console.log(person);
// Output: { name: 'John', age: 30 }
Q. What will be the output delete keyword
const func = (function (a) {
delete a;
return a;
})(5);
console.log(func); // 5