Can't access object property, even though it shows up in a console log

后端 未结 30 1772
日久生厌
日久生厌 2020-11-22 06:26

Below, you can see the output from these two logs. The first clearly shows the full object with the property I\'m trying to access, but on the very next line of code, I can\

30条回答
  •  礼貌的吻别
    2020-11-22 07:18

    I had a similar issue or maybe just related.

    For my case I was accessing properties of an object but one was undefined. I found the problem was a white-space in the server side code while creating the key,val of the object.

    My approach was as follows...

    After removing the white-space from the server-side code creating the object, I could now access the property as below...

    This might not be the issue with the case of the subject question but was for my case and may be so for some one else. Hope it helps.

提交回复
热议问题