1.全局变量
function foo(arg) {bar = \"this is a hidden global variable\"; //window.bar}function foo() {this.variable = \"potential accidental global\";}// Foo 调用自己,this 指向了全局对象(window)// 而不是 undefinedfoo();
2.闭包
function(){let a=1;return function(){console.log(a);}a=null;}
3.遗忘的定时器
如何监控内存泄漏:利用浏览器的memory标签