Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Remove Properties from an Object</title> </head> <body> <script> var person = { name: "Peter", age: 28, gender: "Male", displayName: function() { alert(this.name); } }; // Deleting property delete person.age; document.write(person.age); // Prints: undefined </script> </body> </html>