草庐IT

javascript - Q.nfcall 和 Q.fcall 有什么区别?

我是node.js的新手。我想了解Q.nfcall。我有以下Node.js代码。functionmytest(){console.log('Inmytest');return'aaa';}Q.nfcall(mytest).then(function(value){console.log(value);});我的预期输出应该是:Inmytestaaa但实际输出是:Inmytest我在上面的代码中将Q.nfcall更改为Q.fcall后,输出变成了我预期的结果:Inmytestaaa这是为什么呢?Q.nfcall和Q.fcall有什么区别?谢谢。 最佳答案