Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

delete in javascript

/*The JavaScript delete operator removes a property from an object;
*/
const Employee = {
  firstname: 'John',
  lastname: 'Doe'
};

console.log(Employee.firstname);
// expected output: "John"

delete Employee.firstname;

console.log(Employee.firstname);
// expected output: undefined
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #delete #javascript
ADD COMMENT
Topic
Name
9+3 =