I am trying to learn javascript, and have seen that we can play with object's property's attributes. (i mean value, writable, enumerable, configurable).
And from what i learned, i have thought changing {configurable: false} would restrict any more configuration changes like {writable: false, enumerable: false}
I have written below to try it out, but the results i have got were nothing like the results i have expected.
Am i wrong about what {configurable:false} means or, is there something wrong with the code? TIA.
"use strict";
window.onload = function(){
var o = {x:1};
//Make "x" non-configurable
Object.defineProperty(o, "x", {configurable: false});
//Seal "o";
Object.seal(o);
console.log(Object.getOwnPropertyDescriptor(o, "x"));
//outputs => Object { value: 1, writable: true, enumerable: true, configurable: false }
console.log(Object.isSealed(o));
//outputs => true
Object.defineProperty(o, "x", {writable: false}); //this doesn't cause any errors.
console.log(Object.getOwnPropertyDescriptor(o, "x"));
//outputs => Object { value: 1, writable: false, enumerable: true, configurable: false }
}