Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript delete key from object

let person = {
  firstname: 'John',
  lastname: 'Doe'
}

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

delete person.firstname;

console.log(person.firstname);
// expected output: undefined
 
PREVIOUS NEXT
Tagged: #javascript #delete #key #object
ADD COMMENT
Topic
Name
8+6 =