W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <body> <p>delete 运算符从对象中删除属性。</p> <p id="demo"></p> <script> var person = { firstname:"Bill", lastname:"Gates", age:19, eyecolor:"blue" }; delete person.age; document.getElementById("demo").innerHTML = person.firstname + " is " + person.age + " years old."; </script> </body> </html>