简体   繁体   English

有什么方法可以获取 javascript 变量内存地址?

[英]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. JavaScript 本身意味着与实现无关,因此语言本身故意不包含内存地址等概念。 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.但是请注意,并不能真正保证对象将保留其地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有没有方法来检查Javascript变量的内存地址? - Is there any method to check memory address of Javascript variable? 如何获取 JavaScript 变量的内存地址? - How can I get the memory address of a JavaScript variable? WebAssembly:在JavaScript中从参数(带内存地址)获取字符串的正确方法 - WebAssembly: Correct way to get a string from a parameter (with memory address) in JavaScript JavaScript变量名如何链接到memory地址? - How JavaScript variable name link to memory address? 有什么方法可以将JavaScript变量值转换为JSTL可以使用的值? - Is there any way to get a JavaScript variable value into something JSTL can use? 有没有办法在 ReactJS 中获取 mobx 可观察变量地址 - Is there a way to get a mobx observable variable address in ReactJS 管理Javascript内存中变量的最佳方法是什么 - What is the best way to manage variable in memory for Javascript 怎么知道两个javascript变量指向相同的内存地址 - How to know that two javascript variable point to the same memory address 是他们的任何分配或获取Java变量的Javascript变量? - is their any to assign or get Javascript variable to java variable? 有没有办法在 JavaScript 中重置全局变量 - Is there any way to reset Global variable in JavaScript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM