相关疑难解决方法(0)

Node.js变量声明和范围

当我在node.js中键入它时,我得到了undefined.

var testContext = 15;
function testFunction() {
  console.log(this.testContext);
}
testFunction();
=>undefined
Run Code Online (Sandbox Code Playgroud)

没有var关键字,它传递(=> 15).它在Chrome控制台中运行(有和没有var关键字).

javascript scope node.js

37
推荐指数
3
解决办法
7万
查看次数

标签 统计

javascript ×1

node.js ×1

scope ×1