Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to remove property of object in javascript without delete

const names = {
  father: "Johnny",
  brother: "Billy",
  sister: "Sandy"
}

delete names.father
// { brother: "Billy", sister: "Sandy" }

delete names["father"]
// { brother: "Billy", sister: "Sandy" }
Source by coderrocketfuel.com #
 
PREVIOUS NEXT
Tagged: #remove #property #object #javascript #delete
ADD COMMENT
Topic
Name
2+4 =