javascript - 作为函数参数传递的函数范围
问题描述
document.getElementById('game').addEventListener('click', function startGame() {
console.log('Game is starting!'); // name of the function is given just for debugging purposes
});
startGame 函数的作用域是什么?这个函数在哪里可以访问(在哪里可以调用)?
解决方案
推荐阅读
- python - PyQt5:样式表和来自 QWidget 的继承
- python - 使用 Selenium 和 Python 获取特定元素值
- javascript - 新用户注册后将用户写入 Firestore
- ssh - 具有 ssh 隧道自动化的交互式作业
- python - Python:如何读取多个 .NBT 文件并导出为 JSON?
- angular - Angular 项目返回类型的 esLint 规则
- autodesk-forge - 通过 API 将 Revit 模型文件上传到 BIM360 并保持链接
- javascript - 在行内最近的第三个 div 之后添加创建的元素
- docker - 无法从内部的 Docker 容器和 WSL2 实例连接 Xdebug
- android - 数据报 (UDP) 接收器不工作 - 不接收广播数据包