Garbage Collection in JavaScript
何为垃圾?
test在栈内存,{ name: “test”}和[1, 2, 3, 4, 5]都在堆内存中,{ name: “test”}被覆盖掉了,成了堆内存中的垃圾。
1 | let test = { name: "test"}; |
引用计数法
是一种早期浏览器使用的方法。
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
