Is there such a possibility? There is an Object.getOwnPropertyDescriptor () method. It returns the property settings as an object. When trying to change them


There is no result. What to do to change the settings?

    1 answer 1

     var obj = {}; obj.newDataProperty = "abc"; var descriptor = Object.getOwnPropertyDescriptor(obj, "newDataProperty"); descriptor.writable = false; Object.defineProperty(obj, "newDataProperty", descriptor); 
    • Thanks for the help. - zloctb