Predict Execution 顺序
预测输出 简单
题目
什么做 这个 code print?
代码
console.log("A");
function foo() {
console.log("C");
}
console.log("B");
foo();
console.log("D");
提示
函数是 定义但 不运行直到 called.
解释
Code executes top-to-bottom. First "" is printed. Then foo is defined (but not called yet). Then "B" is printed. Then foo() is called, printing "C". Then "D" is printed. The output is: A, B, C, D (each on its own line).
相关资源
相关课程
- 如何 Programs 工作
学习如何 programs 工作.
查阅不认识的术语
新手友好的术语表用大白话解释编程术语——变量、函数、DOM、Promise 等等。
解读错误信息
用大白话解释常见错误——什么意思、为什么发生、如何修复。
动手做项目
通过引导式项目应用所学,含起始代码与解决方案。