Delete a property or method from an object
You can delete a property or method from an object using the delete keyword.
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
<script type="text/javascript">
var myData = {
name : "JavaScript",
weather : "Good",
};
myData.sayHello = function() {
document.writeln(this.name);
};
delete myData.name;
delete myData["weather"];
delete myData.sayHello;
</script>
</body>
</html>