This is an artifact of the way the Javascript console works when you log an object. The log doesn't contain a copy of all the object properties, it just contains a reference to the object. When you click on the disclosure triangle, it then looks up all the properties and displays them.
In this case, at the time you call console.log(e)
, there's a DOM element in the currentTarget
property. But sometime later, that property is reset to null
for some reason. When you expand the event
object, that's what you see.
A simple example that demonstrates this is:
var foo = { };
for (var i = 0; i < 100; i++) {
foo['longprefix' + i] = i;
}
console.log(foo);
foo.longprefix90 = 'abc';
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…