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

后端 未结 30 2296
日久生厌
日久生厌 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 06:54

    I had the same issue. Solution for me was using the stringified output as input to parsing the JSON. this worked for me. hope its useful to you

    var x =JSON.parse(JSON.stringify(obj));
    console.log(x.property_actually_now_defined);
    

提交回复
热议问题