Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

面试之函数 #15

Open
sundjly opened this issue Mar 25, 2019 · 0 comments
Open

面试之函数 #15

sundjly opened this issue Mar 25, 2019 · 0 comments
Labels

Comments

@sundjly
Copy link
Owner

sundjly commented Mar 25, 2019

如何编写高质量的函数 -- 敲山震虎篇 ---详细介绍了函数中底层知识:
总结如下:

  1. 创建函数,开辟堆内存,以字符串存入函数体,将函数名(变量)的值变为函数体堆内存中地址。
  2. 执行函数,将存储的字符串函数体复制一份到新开辟的栈内存中,使其变为真正的 JS 代码

为什么是栈呢?先进后出(有递归能力) 可以很好的保存和恢复调用现场

@sundjly sundjly added the 面试 label Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant