By giuseppe

2018-09-14 15:18:33 8 Comments

In my JS script (inside a simple html page) I have an Object which I print with console.log(subs). In Dev Console I see that subs is:

> Object { topic: "hgm_giuse/#", qos: 2 }

But If click on the arrow on the left to expand the object I see this:

  qos: 128​
  topic: "hgm_giuse/#"​
  <prototype>: Object { … }

Whre that "128" comes from?


@Achim 2018-09-14 15:24:53

The object just got modified after the first console.log!

You can reproduce it in the dev tools console:

a = {b: 12}
console.log(a) -> {b: 12}
a.b = 24;
console.log(a) -> {b: 24}

When you now expand the first logged out object, it will also show 24 since it is just a reference to a :-)

@giuseppe 2018-09-21 06:48:55

right...I have to debug more to find who is changing that variable...

Related Questions

Sponsored Content

19 Answered Questions

[SOLVED] Colors in JavaScript console

2 Answered Questions

[SOLVED] Why can't I expand this event object in the chrome console?

18 Answered Questions

[SOLVED] Include jQuery in the JavaScript Console

  • 2011-09-19 16:42:34
  • mrtsherman
  • 377515 View
  • 679 Score
  • 18 Answer
  • Tags:   javascript jquery

8 Answered Questions

[SOLVED] What is the correct syntax of ng-include?

2 Answered Questions

2 Answered Questions

13 Answered Questions

[SOLVED] Ng-model does not update controller value

4 Answered Questions

[SOLVED] Firefox Web Console Disabled?

5 Answered Questions

2 Answered Questions

[SOLVED] Python lxml library fails to parse &lt; and &gt;

Sponsored Content