ES5 var
执行上下文
执行栈
对数正日函 昂抵浪,不死难
栈 堆 地址 数值
if( )
=号左右 (es6以后,叫做函数提升 > 变量提升)
自执行
return内容
return下面的代码
checkscope()(); 栈执行顺序1010 不是1100
/* 点的优先级,比等号的优先级高。
*/
var a = {n: 1};
var b = a;
a.x = a = {n: 2};
a.x // undefined
b.x // {n:2}
闭包 作用域 js引擎逃逸分析 func A{a; function B{a++}; return B} 此时a不存到堆中
A返回后,B还可以访问A的变量,更新A的变量
new WeakMap().set(key value) 不计入垃圾机制
window roots 可达的被标记
函数局部变量,全局不用变量
setInterval
addEventListener removeEventListener
闭包的最后,xx=null
'use strict' this为undefined 全局window 不写var 确保用完后设置为null
null undefined 皮之不存毛将焉附
execution context。执行环境-变量对象-window
作用域链-解释器-变量-当前作用域-父级作用域
作用域找不到:ReferenceError 属性or原型链:undefined
网友评论