学习文章 -----汤姆大叔的博客

总结笔记

1. 只有在函数被调用的时候,才会进入函数的执行上下文环境。

2. 执行上下文代码分为两个阶段:①进入执行上下文。②执行代码。

 

实例:

function test(a, b) {
  var c = 10;
  function d() {}
  var e = function _e() {};
  (function x() {});
}
 
test(10); // call

第一个阶段:进入执行上下文。

AO(test) = {
  a: 10,
  b: undefined,
  c: undefined,
  d: <reference to FunctionDeclaration "d">
  e: undefined
};

第二个阶段:执行代码。

AO['c'] = 10;
AO['e'] = <reference to FunctionExpression "_e">;

  

相关文章:

  • 2021-05-26
  • 2022-01-30
  • 2021-11-25
  • 2021-04-08
  • 2021-05-28
  • 2022-12-23
  • 2021-08-25
  • 2023-03-19
猜你喜欢
  • 2022-12-23
  • 2021-07-17
  • 2022-01-26
  • 2021-10-09
  • 2021-10-31
  • 2022-01-24
  • 2021-12-21
相关资源
相似解决方案