The delete keyword is used to delete the property as well as its value.
1 2 3 4 | var user= {name: "John", age:20}; delete user.age; console.log(user); // {name: "John"} |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.