垃圾回收机制的原理 垃圾回收机制的原理(1)找出不再使用的变量(2)释放其占用内存(3)固定的时间间隔运行 function test(){ var a = 1; return function() { a++; console.log(a); }}var test = test1();test(); // 2test(); // 3test(); // 4test = null;test(); // 报错