博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[Javascript] Call Stack
阅读量:6970 次
发布时间:2019-06-27

本文共 897 字,大约阅读时间需要 2 分钟。

Every time when a function run it will be push into the call stack and put on the top,  you can think call stack is something like a heap... Javascirpt has only one call stack. 

 

In the picture, main() get call first, so put into the call stack;

second, printSquare(), put into the call stack;

third, inside printSquare() call suqare() function, so put into call stack;

fourth, inside square() function, multiply() function get call....

 

--------------------------

 

When function return or done, the function will be poped up from the call stack:

So, multiply() function ruturned, so pop up from the call stack;

then square();

then inside printSquare() function, console.log() funciton get call, so need to push intot the call stack.

After that, console.log() pop up;

printSquare() pop up;

finally main() pop up;

 

You can see the call stack from the Chrome dev tool's source tab when you use 'debugger'.

 

转载地址:http://ofasl.baihongyu.com/

你可能感兴趣的文章
WireShark开启IP, TCP,UDP校验和的办法
查看>>
小程序组件概述
查看>>
【spring boot】【log4jdbc】使用log4jdbc打印mybatis的sql和Jpa的sql语句运行情况
查看>>
C#中使用SqlBulkCopy的批量插入和OracleBulkCopy的批量插入
查看>>
Redis详解(五)------ redis的五大数据类型实现原理
查看>>
python笔记17-字典如何按value排序
查看>>
Web缓存知识体系
查看>>
【TP3.2】TP3.2的 FIND_IN_SET()的用法
查看>>
BZOJ3265: 志愿者招募加强版(线性规划)
查看>>
static 和 final 关键字 对实例变量赋初始值的影响
查看>>
从世界消失
查看>>
超高逼格Log日志打印
查看>>
Java提高:采用异常链传递异常
查看>>
OpenGL——旋转的六边形(动画)
查看>>
string operation in powershell
查看>>
PyCharm切换Python版本
查看>>
SQL Server中LIKE %search_string% 走索引查找(Index Seek)浅析
查看>>
在WPF中制作正圆形公章
查看>>
dataframe 合并(append, merge, concat)
查看>>
C#获取类名为Internet_Explorer_Server控件的内容
查看>>