What are the benefits of making properties non-enumerable?
I think the main benefit is to be able to control what shows up when enumerating an object’s properties, such as for in or Object.keys(). MDN explains it well with Object.defineProperty: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/defineProperty So normally, when people want to add a method to Object, such as a polyfill for some method not supported in old browsers, … Read more