[英]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.