标签:程序 弹出框 als nbsp ble rabl obj val define
1.Value的值为只读的(defineProperty.规定属性,):
<script>
var person={};
Object.defineProperty(person,"name",{
writable: flase, //如果这里改为true,则第二个弹出框则为Grey
value:"Nicholas"
});
alert(person.name); //Nicholas
person.name="Grey";
alert(person.name); //Nicholas
</script>
<script>
var person={};
Object.defineProperty(person,"name",{
configurable: false,
value:"Nicholas"
});
alert(person.name);
delete person.name;
alert(person.name);
</script>
标签:程序 弹出框 als nbsp ble rabl obj val define
原文地址:http://www.cnblogs.com/meiqiyuanzi/p/7477940.html