简体   繁体   中英

Why does a var change when I inspect it in Chrome Dev tools?

在此处输入图片说明

I have a React Native project and for some recent Chrome dev tools is giving me two different reads on a variable property when I expand it.

Why does position property change when I expand the object in Chrome dev tools? It's not just a visual issue in dev tools, it also happens occurs in the code execution.

It changes because of the code execution changes it!

When you click on expand, chrome will re-evaluate the current value of the object, and show that. If in between the initial log and your expansion, the object gets changed by your code, chrome is going to show that change.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM