0

The object '0' expanded below with the property, date, is an object in its own, but the object is empty when expanded except for the proto object. What is the greyed out date about?? It doesnt look like the object's key, since "date" should be the key.

I'm trying to replicate this object and have no idea how or what's going on.

mplungjan
  • 169,008
  • 28
  • 173
  • 236
ima_prog
  • 119
  • 1
  • 9

1 Answers1

1

The greyed-out thing is part of the immediate representation of the Date object in the console - just like it is displaying Array(200) for your array.

You will get the same representation when doing console.dir as when having the object as a property of another object.

You will get a different representation when doing console.log, as that shows different things depending on the type of the logged value and not always the expansible object representation.

the object is empty when expanded except for the proto object.

Yes, Date instances don't have any own properties. The timestamp value is stored in an internal property which is not shown by the devtools.

Bergi
  • 630,263
  • 148
  • 957
  • 1,375