In nodejs documentation for the util.inspect function, the documentation states that “If showHidden is true, then the object’s non-enumerable properties will be shown too.”
Does non-enumerable properties refer to prototypes only? Or are there other non-enumerable properties I haven’t considered?
Link to documentation in question: http://nodejs.org/docs/v0.4.8/api/util.html#util.inspect
Enumerable properties and prototype properties are unrelated. It just happens that most (all?) of the prototype properties on native objects are non-enumerable.
To show that both prototype and instance properties can be both enumerable or non-enumerable:
You can create non-enumerable properties on your own objects with
defineProperty():On the other hand, prototype properties that you add (non-native) are by default enumerable, even if you add them to the prototypes of native objects: