0

Google Chrome (Version 62.0.3202.94), when inspecting a given object, tells me that length of the array should be 4. When I develop the object to inspect the array's content, it's empty. See attached screen shot. I was wondering why. This is an Angular application, using TypeScript 2.6.1 (partial content of the tsconfig.json file) :

"target": "es5",
"typeRoots": [
  "node_modules/@types"
],
"lib": [
  "es2017",
  "dom"
],

enter image description here

  • 1
    The battle of the century – Jonas Wilms Nov 20 '17 at 17:45
  • When you log values to console as text, it is the value the moment you log it that gets printed. However, if you print an object reference and click it, you will see the final state of the object, when the script is finished (or in current state if still running) – Kaddath Nov 20 '17 at 17:45
  • 1
    Did you try opening the ▶ and seeing if anything is there? – Soolie Nov 20 '17 at 17:45
  • 1
    `JSON.stringify(yourobject)`... or.. Really, the little "i". Reference, remember. Reference. – briosheje Nov 20 '17 at 17:48

1 Answers1

1

See the tooltip on the little i icon next to the first line.

The first line prints the object as it was when you logged it.

The expanded details print its current values.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964