We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
笔记
this
/* * 这是一张 JavaScript 代码草稿纸。 */ function averageScore(players) { var i, n, sum; sum = 0; for (var i = 0, n = players.length; i < n; i++) { sum += players[i]; } return sum / n; } averageScore([7, 8, 9]) /* 8 */
// 添加或修改全局变量会自动更新全局对象 this.foo; /* undefined */ foo = "global foo"; this.foo; /* global foo */ // 更新全局对象也会自动地更新全局命名空间 var foo = "global foo"; this.foo = "changed"; foo /* changed */
全局对象的**特殊用途:**由于全局对象提供了全局环境的动态反应机制,所以可以使用它查询一个运行环境,检测在这个平台下哪些特性是可用的。
typeof(this.JSON) /* object */
提示
The text was updated successfully, but these errors were encountered:
xiaoluoboding
No branches or pull requests
笔记
this
关键字的初始值全局对象的**特殊用途:**由于全局对象提供了全局环境的动态反应机制,所以可以使用它查询一个运行环境,检测在这个平台下哪些特性是可用的。
提示
The text was updated successfully, but these errors were encountered: