suchen

Heim  >  Fragen und Antworten  >  Hauptteil

Darüber in nodejs – Stack Overflow

Ich verstehe die Wahrheit. Ich möchte nur wissen, wie der folgende Code in der NodeJS-Umgebung läuft

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

Warum kann

in diesem Code am Ende console 出来 [Function: declareFunc] stehen?

我想大声告诉你我想大声告诉你2809 Tage vor813

Antworte allen(2)Ich werde antworten

  • 漂亮男人

    漂亮男人2017-07-05 10:38:05

    最后执行打印的信息是 console.log(declareFunc); 这一句

    Antwort
    0
  • 伊谢尔伦

    伊谢尔伦2017-07-05 10:38:05

    来看看这篇:
    Nodejs中的一些小trick - QueenKing - SegmentFault /a/11...

    Antwort
    0
  • StornierenAntwort