【发布时间】:2019-02-18 18:43:51
【问题描述】:
在console.log 中,我收到了关于对象canHandle: [Function: canHandle] 和第二个canHandle: [Function] 的输出。两者有什么区别?
const SessionEndedRequest = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'SessionEndedRequest';
}
};
返回canHandle: [Function: canHandle]
和
obj = {};
obj.canHandle = function (handlerInput) {
return handlerInput.requestEnvelope.request.type === that.type
&& handlerInput.requestEnvelope.request.intent.name === that.name;
}
回复canHandle: [Function]
【问题讨论】:
-
请贴出你用来产生这些输出的代码,并说明你在什么环境下运行它。
-
可能第一个函数有名字,第二个没有,但我们只能猜测。
-
关于
console.log方法,您始终可以使用debugger魔术字进行真正的调试
标签: javascript node.js alexa console.log