Creating a non-enumerable property with Object.defineProperty

We've seen in previous recipes how to avoid having properties overridden. There are situations where we might not want a property to be read. Recall the Object.entries method, which creates an iterator of all the properties and values on the object. Well, that's not precisely true. It creates an iterator of all the enumerable properties.

In this recipe, we'll see how to create properties that won't be included in the iterator.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.6.154