JSFiddle - React, Tailwind, and code Playground
JavaScript
var obj = {};
Object.defineProperty(obj, "foo", {
configurable: true,
value: "bar",
});
Object.defineProperty(obj, "foo", {
value: "boobar",
});
Object.defineProperty(obj, "foo", {
writable: true
});
Object.defineProperty(obj, "foo", {
value: "boobar",
});
console.log(obj.foo)
// Uncaught TypeError: Cannot redefine property: foo