What is the significance of faded properties when using console.dir in Chrome Developer Tools Console

Faded properties apper to indicate non-enumerable properties. If we do:

var a = {};
Object.defineProperties(a, {
    hello: { enumerable: false },
    world: { enumerable: true }
});
console.dir(a);

then we see that hello is faded, while world is not.

console image showing faded <code>hello</code> property

In your code, if you do for(prop in obj) { console.log(prop); } (where obj is whatever object you’re showing us in your console screenshot), you’ll see that only the faded properties are not enumerated.

You can also check this with Object.getOwnPropertyDescriptor(obj, "worldVisible"), which should return an object with an enumerable: false property.

Note that the italics on the property names indicate that the property value is defined by a getter function. (This also causes the value to display a (...) value before the function is run.) This is a totally separate issue from enumerability, which causes the names to be faded. You can have italic getter-defined properties that are not faded non-enumerable properties, and vice versa.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)