JSFiddle - React, Tailwind, and code Playground
HTML
<div id="console">
</div>
JavaScript
$(document).ready(function () {
function MyObject() {
// some constructor instructions
Object.freeze(this.staticAttribute);
};
MyObject.prototype.staticAttribute = "some value";
var childObject = new MyObject(); // instantiate child object
$("#console").append("<strong>Initial Values</strong></br>");
$("#console").append("MyObject.prototype.staticAttribute initial value is ' "+MyObject.prototype.staticAttribute+" '</br>");
$("#console").append("childObject.staticAttribute initial value is ' "+childObject.staticAttribute+" '</br></br>"); // test attribute
$("#console").append("<strong>Changing the Parent Prototype property/attribute value cascades to the child</strong></br>");
MyObject.prototype.staticAttribute = "something else entirely";
$("#console").append("MyObject.prototype.staticAttribute is now ' "+MyObject.prototype.staticAttribute+" '</br>");
$("#console").append("childObject.staticAttribute is now ' "+childObject.staticAttribute+" '</br></br>");
$("#console").append("<strong>Changing the Child property/attribute value detaches it from the parent</strong></br>");
childObject.staticAttribute = "something else";
$("#console").append("MyObject.prototype.staticAttribute is now ' "+MyObject.prototype.staticAttribute+" '</br>");
$("#console").append("childObject.staticAttribute is now ' "+childObject.staticAttribute+" '</br></br>");
});