当一个值存储在内存中时,我的理解是值本身存储在内存中,但是当涉及到对象时,它是如何存储在内存中的?
最佳答案
下面给出了对象如何存储在内存中的一个好主意:
Most objects contain all their properties in a single block of memory ("a", and "b"). All blocks of memory have a pointer to a map, which describes their structure. Named properties that don't fit in an object are usually stored in an overflow array ("c", and "d"). Numbered properties are stored separately, usually in a contiguous array.
更多信息请阅读here .
关于javascript - 当一个对象被存储在内存中时,它的值是只被存储还是作为一个对象被存储?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46167621/