0

I try to access to a javascript object property but there is a difference between what I get and what I see into the console.

Here is a debug of my object. On the console, when it displays only one line, I see:

s {longitude: 0.1367152479042797, latitude: 0.8081125973585543, height: 638}

But when I click on the line to show the details I see:

s {longitude: 0.1367152479042797, latitude: 0.8081125973585543, height: 638}

    height:764.1600000000001

    latitude:0.8081125973585543

    longitude:0.1367152479042797

    __proto__:Object

The value I'm looking for is the height. It's 638 in the s{..., height: 638} but 764.1600000000001 when I look the details.

The "correct" value is 764.... but how to access to this value? If I ask myObject.height, I get 638.

I'm lost. Can anyone help, please?

  • can you show us the code that creates this object – Joe Warner Mar 29 '18 at 12:08
  • @Aluan Haddad the correct value. – Frontear Mar 29 '18 at 12:09
  • 1
    I'll take a stab into the dark and say it's a [duplicate](https://stackoverflow.com/questions/24175017/google-chrome-console-log-inconsistency-with-objects-and-arrays); if that's not it, give us a complete reproducible example. – deceze Mar 29 '18 at 12:10

0 Answers0