2020-11-25 Strange can output obj but obj.key shows undefined

Encountered a very strange question
can output obj
but obj.key on undefined
One reason I thought it was to do with the Chinese key is
but an empty test page without problems
even more strange is that
sometimes get get key
sometimes not obtain key
Finally Object.keys gets the length of the object and it feels even more weird when it is
found to be 0. Obviously, obj can be output on the page but the length is 0. Then setTimeout is added. The reason is probably a series of calculations to obtain and output on the display. I think it is good I got the data , but I don’t have it. You have to wait . If you encounter it in the future, sometimes there will be no such thing. Consider adding setTimeout as soon as possible.







Found: Even if the data has not been obtained, the browser console.log will display it after it is obtained

Guess you like

Origin blog.csdn.net/yuyu_2019/article/details/110151521