简体   繁体   中英

any way to get javascript variable memory address?

有什么方法可以获取 JavaScript 变量的内存地址,因为在比较[1,2,3] === [1,2,3]之类的东西时,它看起来像true但它是false的,还有这个内存地址也将帮助我理解字符串的可变性和不变性

JavaScript itself is meant to be implementation-agnostic, so concepts like memory addresses are intentionally absent from the language itself. Outside of the language, you can use the browser's debugging tools to take a memory snapshot, and that might contain the information. Note, however, that there is no real guarantee that an object will retain its address.

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