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.
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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…