About this in nodejs - Stack Overflow
我想大声告诉你
我想大声告诉你 2017-07-05 10:36:05
0
2
769

I understand the truth. I just want to know how the following code runs in the nodejs environment

var varFunc = function declareFunc() {
    console.log(this);
    console.log(global);
    console.log(global.declareFunc);
    console.log(declareFunc);
}
console.log(this)
varFunc();

Why does console come out in the end of this code [Function: declareFunc]?

我想大声告诉你
我想大声告诉你

reply all(2)
漂亮男人

The last information printed is console.log(declareFunc);This sentence

伊谢尔伦

Let’s take a look at this article:
Some little tricks in Nodejs - QueenKing - SegmentFault /a/11...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template