Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Call stack

我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译!

A call stack is a mechanism for an interpreter (like the JavaScript interpreter in a web browser) to keep track of its place in a script that calls multiple functions — what function is currently being run, what functions are called from within that function and should be called next, etc.

  • When a script calls a function, the interpreter adds it to the call stack and then starts carrying out the function.
  • Any functions that are called by that function are added to the call stack further up, and run where their calls are reached.
  • When the main function is finished, the interpreter takes it off the stack and resumes execution it left off in the main code listing.
  • If the stack takes up more space than it had assigned to it, it results in a "stack overflow" error.

Learn more

General knowledge

文档标签和贡献者

 此页面的贡献者: chrisdavidmills, klez, SnehJain, Andrew_Pfeiffer
 最后编辑者: chrisdavidmills,