作用域

    xiaoxiao2022-07-06  206

    作用域

    function a(){ function b(){ var b=234; a=0; } var a=123; b(); console.log(a); //a=0 } var glob=100; a(); //a defined a.[[scope]]-->0:GO{} //a doing a.[[scope]]-->0:GO{} // 1:GO{} function a(){ function b(){ function c(){ } c(); } b(); } a(); //a defined a .[[scope]]-->0:GO //a doing a.[[scope]]-->0:aAo // 1:GO //b definde b.[[scope]]-->0:aAO // 1:GO //b doing b.[[scope]]-->0:bAO // 1:aAO // 2:GO //c defined c.[[scope]] -->0:bAO // 1:aAO // 2:GO //c doing c.[[scope]]-->0:cAO // 1:bAO // 2:aAO // 3:GO
    最新回复(0)