Javascript: "control"的定义是什么?

标签 javascript

在Javascript中,“控制”的定义是什么?和浏览器的javascript解释器是一样的吗?

这是我读过的两个地方:

"When control comes across such a statement, it immediately jumps out of the current function and gives the returned value to the code that called the function." Eloquent Javascript

"Execution of the current function will stop (the statements after throw won't be executed), and control will be passed to the first catch block in the call stack. If no catch block exists among caller functions, the program will terminate." Mozilla Developer Network

最佳答案

JavaScript 是一种命令式编程语言。因此,它的工作原理是按某种顺序依次执行语句。因此,在任何给定时刻,程序中都有一个点“当前正​​在执行”。

当前执行点被称为“程序计数器”(PC)、“指令指针”(IP)或简称为“控制”。

关于Javascript: "control"的定义是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32912028/

相关文章:

javascript - 提交时立即显示所有内联验证消息

javascript - 有没有办法告诉谷歌地图以标记为中心缩小并显示计算出的边界框?

javascript - 如何在 <select> 元素上更改的 selectedIndex 上绑定(bind)事件?

javascript - 如何防止 React 重新渲染整个组件

javascript - 如何快速逐像素处理图像?

javascript - 响应广场

javascript - Cordova:在浏览器中测试警报插件?

Javascript:发现给定条件为真后,如何在标签内添加 HTML 代码?

javascript - 如何创建一个部分来显示博客上特定标签的最新帖子?

javascript - 切换两个箭头的颜色变化