基本了解

function test1() {
	var a = 1;
  return function() {
  	a++;
    console.log(a);
  }
}
var test = test1();
test();
test();
test();

Untitled

解除闭包内存

function test1() {
	var a = 1;
  return function() {
  	a++;
    console.log(a);
  }
}
var test = test1();
test();
test();
test();
test = null;

标记清除 mark and sweep

引用计数 reference counting