📜  使对象只读 javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:19.186000             🧑  作者: Mango

代码示例1
var obj = {};
Object.defineProperty(obj, "prop", {
    value: "test",
    writable: false
});