Object.defineProperty() – There’s More Than One Way to Skin a Cat

private property sign

definition: sketchy

I thought Id try and do something different for this blog and post some code that runs through how a specific piece of JavaScript Works

The Object.defineProperty() is a method that can create or modify a property of an object with a couple of special caveats added. Using this method you have the ability to make the property and the method read-only (writable and configurable) or invisible (enumearble).  For a more in depth explanation the Mozilla page can be found here and another very helpful blog on the method can be found here.

But this page is the copy of a JSFiddle post that I have been playing around with in an attempt to strengthen my understanding of it, you should give it a shot too. The link to the actually JSFiddle page can be found here.

 

Leave a Reply

Your email address will not be published. Required fields are marked *